Не удалось загрузить сборки EnterpriseLibrary при отображении представления в приложении MVC - PullRequest
1 голос
/ 10 марта 2011

При рендеринге представления в приложении ASP.NET MVC я получаю следующий Желтый экран смерти.Это произойдет только один раз в течение жизненного цикла сервера, последующие рендеры работают нормально.У меня нет никаких ссылок на EnterpriseLibrary 4.0.0.0 в самом приложении, что заставляет меня думать, что ссылка находится за пределами моего приложения (machine.config или что-то подобное).Я проверил ссылки EnterpriseLibrary в C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config и C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ config \ machine.config, но ниимел какую-либо ссылку.Есть идеи?

Заранее спасибо.

РЕДАКТИРОВАТЬ: ошибка происходит в следующей строке: ., ранее казалось, что произошла ошибка при вызове Telerik.

EDIT2: я могу исправить ошибку, удалив что еще указывает на эту проблему.Однако я не уверен, почему это происходит, и не могу утверждать, что у меня есть ответ на проблему.

Вот YSOD:

Server Error in '/services' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 153:<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
Line 154:   
Line 155:   < asp:ScriptManager ID="ScriptManager2" EnablePartialRendering="false" runat="server" / >
Line 156:   <%= Html.Telerik().ScriptRegistrar() %>
Line 157:   


Source File: c:\HIP\HWMI.API\HWMI.API.Web\Views\Membership\UserSubscriptionDetails.aspx    Line: 155 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded.


=== Pre-bind state information ===
LOG: User = HWI\jyoung
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/HIP/HWMI.API/HWMI.API.Web/
LOG: Initial PrivatePath = C:\HIP\HWMI.API\HWMI.API.Web\bin
Calling assembly : Microsoft.Practices.EnterpriseLibrary.Security.Cache.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\HIP\HWMI.API\HWMI.API.Web\web.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: The same bind was seen before, and was failed with hr = 0x80070002.



Stack Trace: 


[FileNotFoundException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +180
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +192
   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +115
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +426
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103
   System.Reflection.RuntimeAssembly.GetCustomAttributes(Boolean inherit) +33
   System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +76
   System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +388
   System.Web.UI.ScriptManager..ctor() +26
   ASP.views_membership_usersubscriptiondetails_aspx.__BuildControlScriptManager2() in c:\HIP\HWMI.API\HWMI.API.Web\Views\Membership\UserSubscriptionDetails.aspx:155
   ASP.views_membership_usersubscriptiondetails_aspx.__BuildControlContent3(Control __ctrl) in c:\HIP\HWMI.API\HWMI.API.Web\Views\Membership\UserSubscriptionDetails.aspx:153
   System.Web.UI.CompiledTemplateBuilder.InstantiateIn(Control container) +12
   System.Web.UI.MasterPage.InstantiateInContentPlaceHolder(Control contentPlaceHolder, ITemplate template) +87
   ASP.views_shared_site_master.__BuildControlScriptContent() in c:\HIP\HWMI.API\HWMI.API.Web\Views\Shared\Site.Master:389
   ASP.views_shared_site_master.__BuildControlTree(views_shared_site_master __ctrl) in c:\HIP\HWMI.API\HWMI.API.Web\Views\Shared\Site.Master:1
   ASP.views_shared_site_master.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\services\1a8554fb\b8d3a14c\App_Web_b1lugo2u.0.cs:0
   System.Web.UI.UserControl.InitializeAsUserControlInternal() +35
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8832342
   System.Web.UI.Page.get_Master() +54
   System.Web.UI.Page.ApplyMasterPage() +15
   System.Web.UI.Page.PerformPreInit() +45
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +328




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 

1 Ответ

2 голосов
/ 14 марта 2011

ASP.NET MVC не поддерживает объект ScriptManager. Это имеет смысл, поскольку ScriptManager является элементом веб-форм и не попадает в мир MVC. Что касается того, почему IIS пытается загрузить несвязанные сборки, когда бомбы ScriptManager, я до сих пор не знаю. Кажется, он загружает все, что находится в каталоге BIN (я оставил сборки EntLib 4.0 в BIN), но затем продолжает загружаться и после этого. Я прекратил попытки добраться до конца того места, откуда он загружался, когда IIS вернул сообщение «Не удалось загрузить файл или сборку DeployLX.Licensing.v4». Я исправил, удалив все ссылки ScriptManager из приложения MVC, так как они в любом случае не требовались. Если бы я использовал их, то был бы доступен MVC ScriptManager http://mvcscriptmanager.codeplex.com/

ТЛ; др; MVC не поддерживает ScriptManager. Я удалил это.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...