求高手帮忙
该引用的.dll都引用了
报错:
未能从程序集“mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”中加载类型“System.Reflection.IntrospectionExtensions”。
using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.Practices.Unity;using Microsoft.Practices.Unity.Configuration;using System.Configuration;namespace test2{ interface Car { string GetSize(); } public class SmallCar : Car { #region public string GetSize() { return "我是小车"; } #endregion } public class BigCar : Car { #region public string GetSize() { return "我是大车"; } #endregion } public class Program { static void Main(string[] args) { Car sc = getContainer().Resolve<SmallCar>("small"); Car bc = getContainer().Resolve<BigCar>("big"); string smallMsg = sc.GetSize(); string bigMsg = bc.GetSize(); Console.WriteLine(smallMsg); Console.WriteLine(bigMsg); Console.ReadKey(); } static IUnityContainer getContainer() { IUnityContainer myContainer = new UnityContainer(); UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("car"); return section.Configure(myContainer, "myContainers"); } }}