无法加载文件或程序集 "Mono.Cecil, Version=0.9.6.0; 初始化CMS应用程序。

问题描述 投票:0回答:1

我在kentico 11上运行网站,当我试图通过iis在本地托管和运行时,得到以下错误。然后,我没有得到这个问题。

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 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 23: 
Line 24:         // Initialize CMS application. This method should not be called from custom code.
Line 25:         InitApplication();
Line 26:     }
Line 27: 

Source File: \CMS\App_Code\Global.asax.cs    Line: 25
Stack Trace:


[FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.]
   CMS.Core.AssemblyDiscovery.IsAssemblyDiscoverable(String filePath) +0
   CMS.Core.AssemblyDiscovery.AddOnlyDiscoverableAssembly(ICollection`1 assemblies, Dictionary`2 preloadedAssemblies, AssemblyName assemblyName, String filePath) +131
   CMS.Core.AssemblyDiscovery.ExecuteGetAssemblies(Boolean onlyDiscoverable) +1192
   CMS.Core.AssemblyDiscovery.get_DiscoverableAssemblies() +31
   CMS.Core.TypeManager.PreInitializeTypes() +193
   CMS.Core.ModuleEntryManager.PreInit() +19
   CMS.Core.AppCore.PreInit() +146
   CMS.DataEngine.CMSApplication.PreInit() +164
   CMS.DataEngine.CMSHttpApplication.InitApplication() +24
   Global..cctor() in \CMS\App_Code\Global.asax.cs:25

[TypeInitializationException: The type initializer for 'Global' threw an exception.]
   Global..ctor() +0
   ASP.global_asax..ctor() +48

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +142
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +82
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +174
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737

我是一个很好的朋友。

kentico kentico-11
1个回答
1
投票

这个包是通过nugets添加到解决方案中的。它在packages.config中引用。清理和重建应该有帮助。确保它存在于packages文件夹中,如果不存在,请恢复nugets(或)。Update-Package )的解决方案,并尝试重新构建。它必须存在于编译后的bin文件夹中。

© www.soinside.com 2019 - 2024. All rights reserved.