2011-04-06 50 views
0

我們最近升級到了Castle Windsor的2.5.3版本,以便在試圖運行時利用完全和部分信任的代碼訪問機制一個exe文件在UNC上。我們得到以下錯誤:城堡2.5.3 .NET 4未能通過UNC讀取配置文件

System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for castle: Request failed. 
(\\server\dev\oursolution.VS2010Clean\OurApp\bin\x86\Release\OurApp.exe.Config 
line 10) ---> System.Security.SecurityException: Request failed. 

    at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) 

    at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) 

    at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) 

    at System.Activator.CreateInstance(Type type, Boolean nonPublic) 

    at 
System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission(Type type) 

    at 
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.Init(RuntimeConfigurationRecord 
configRecord, FactoryRecord factoryRecord) 

    at 
System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactory.InitWithRestrictedPermissions(RuntimeConfigurationRecord 
configRecord, FactoryRecord factoryRecord) 

    at 
System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(FactoryRecord 
factoryRecord) 

    at 
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String 
configKey, Boolean& isRootDeclaredHere) 

    --- End of inner exception stack trace --- 

    at 
System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String 
configKey, Boolean& isRootDeclaredHere) 

    at 
System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String 
configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& 
resultRuntimeObject) 

    at System.Configuration.BaseConfigurationRecord.GetSection(String 
configKey) 

    at 
System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String 
sectionName) 

    at System.Configuration.ConfigurationManager.GetSection(String 
sectionName) 

    at Castle.Core.Resource.ConfigResource..ctor(String sectionName) in e:\OSS.Code\Castle.Core\src\Castle.Core\Core\Resource\ConfigResource.cs:line 
44 

    at Castle.Core.Resource.ConfigResource..ctor() in e:\OSS.Code\Castle.Core\src\Castle.Core\Core\Resource\ConfigResource.cs:line 
32 

    at 
OurNamespace.DependencyInjection.ApplicationStartupTask.CreateDependencyResolver() 
in 
OurSolution.VS2010Clean\OurAssembly\DependencyInjection\ApplicationStartupTask.cs:line 
70 

    at 
OurAssembly.DependencyInjection.ApplicationStartupTask.Execute(IDataConfiguration 
dataConfiguration) in 
OurSolution.VS2010Clean\OurAssembly\DependencyInjection\ApplicationStartupTask.cs:line 
46 

    at OurProgram.Startup() in OurSolution.VS2010Clean\OurApp\Program.cs:line 83 

    at OurApp.Program.Main() in OurSolution.VS2010Clean\OurApp\Program.cs:line 37 

我們做了周圍的一些狩獵,但都痛心地看到有人說,這是一個已知的.NET 4的bug。

有沒有人知道這件事?

非常感謝任何輸入 乾杯 科林

回答

0

什麼,如果你把溫莎配置在一個單獨的文件,並嘗試通過

container.Install(Configuration.FromXml(new UncResource("your UNC path"))): 
+0

感謝這個基耶斯洛夫抓住它,我們使用的組合你的答案加上這裏的信息http://social.msdn.microsoft.com/Forums/en-US/clr/thread/1e14f665-10a3-426b-a75d-4e66354c5522 – 2011-04-11 19:47:24