Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 3.17 KB  |  views: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. windsor ioc in console app
  2. private static IWindsorContainer container;
  3. static void Main(string[] args)
  4. {
  5.     container = new WindsorContainer(new XmlInterpreter(new ConfigResource("castle")));
  6. ...
  7.        
  8. <configSections>
  9.     <section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
  10.   </configSections>
  11.  
  12.   <castle>
  13.     <components>
  14.       <component
  15.         id="myrepository"
  16.         service="_123App.Repositories.IMyRepository, _123App"
  17.         type="_123App.Repositories.MyRepository, _123App"
  18.       />
  19.     </components>
  20.   </castle>
  21.        
  22. Could not convert from '_123App.Repositories.MyRepository, _123App' to System.Type - Maybe type could not be found
  23.        
  24. Castle.MicroKernel.SubSystems.Conversion.ConverterException was unhandled
  25.   Message=Could not convert from '_123App.Repositories.MyRepository, 123App._123App' to System.Type - Maybe type could not be found
  26.   Source=Castle.Windsor
  27.   StackTrace:
  28.        at Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.PerformConversion(String value, Type targetType) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorMicroKernelSubSystemsConversionTypeNameConverter.cs:line 91
  29.        at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion(String value, Type targetType) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorMicroKernelSubSystemsConversionDefaultConversionManager.cs:line 134
  30.        at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion[TTarget](String value) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorMicroKernelSubSystemsConversionDefaultConversionManager.cs:line 162
  31.        at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorWindsorInstallerDefaultComponentInstaller.cs:line 196
  32.        at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorWindsorInstallerDefaultComponentInstaller.cs:line 52
  33.        at Castle.Windsor.WindsorContainer.RunInstaller() in e:OSS.CodeCastle.WindsorsrcCastle.WindsorWindsorWindsorContainer.cs:line 314
  34.        at Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter interpreter) in e:OSS.CodeCastle.WindsorsrcCastle.WindsorWindsorWindsorContainer.cs:line 87
  35.        at _123App.Program.Main(String[] args) in C:UsersUsernameDocumentsVisual Studio 2010Projects_123App_123AppProgram.cs:line 18
  36.        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
  37.        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
  38.        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
  39.        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
  40.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
  41.        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
  42.        at System.Threading.ThreadHelper.ThreadStart()
  43.   InnerException:
clone this paste RAW Paste Data