C# 如何将Untiy配置从1.2.*转换为2.0*

C# 如何将Untiy配置从1.2.*转换为2.0*,c#,configuration,web-config,unity-container,C#,Configuration,Web Config,Unity Container,在Unity 1.2中,我将此文本保存在web.config中 如何将它们转换为Unity 2.0配置文件 对不起,我的英语不好对不起大家, 我刚刚解决了这个问题。 问题来自type=“RouteCollection”,我需要删除该文本对不起,各位, 我刚刚解决了这个问题。 问题来自type=“RouteCollection”,我需要删除该文本从学习正确拼写开始。从学习正确拼写开始。 <type type="IRouteRegistry" mapTo="TownHall.Mvc

在Unity 1.2中,我将此文本保存在web.config中

如何将它们转换为Unity 2.0配置文件

对不起,我的英语不好

对不起大家, 我刚刚解决了这个问题。 问题来自type=“RouteCollection”,我需要删除该文本

对不起,各位, 我刚刚解决了这个问题。
问题来自type=“RouteCollection”,我需要删除该文本

从学习正确拼写开始。从学习正确拼写开始。
      <type type="IRouteRegistry" mapTo="TownHall.Mvc.Routing.TownHallRoutes,TownHall.Mvc">
        <typeConfig extensionType="Microsoft.Practices.Unity.Configuration.TypeInjectionElement,Microsoft.Practices.Unity.Configuration">
          <constructor>
            <param name="routes" parameterType="RouteCollection">
              <dependency name="ApplicationRouteCollection" />
            </param>
            <param name="routeHandlerType" parameterType="System.Type">
              <dependency name="RegisterRoutesHandler"/>
            </param>
            <param name="settings" parameterType="IAppSettings">
              <dependency/>
            </param>
          </constructor>
        </typeConfig>
      </type>
 <register type="IRouteRegistry" mapTo="TownHall.Mvc.Routing.TownHallRoutes, TownHall.Mvc">
   <constructor>
     <param name="routes" type="RouteCollection">
       <dependency name="ApplicationRouteCollection" />
     </param>
     <param name="routeHandlerType" type="System.Type">
       <dependency name="RegisterRoutesHandler" />
     </param>
     <param name="settings" type="IAppSettings">
       <dependency />
     </param>
   </constructor>
 </register>
       IUnityContainer townhallContainer = new UnityContainer();
       UnityConfigurationSection config = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");

       config.Configure(townhallContainer); // I got error here

       return townhallContainer;