ASP.NET c#怎么上传后服务器上打开出错呢? 本机上是没有问题的,现在不知错在哪里?请高手帮忙,谢谢!
Could not load file or assembly 'App_Licenses' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
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.BadImageFormatException: Could not load file or assembly 'App_Licenses' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'App_Licenses' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[BadImageFormatException: Could not load file or assembly 'App_Licenses' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Compilation.BuildManager.LoadLicensesAssemblyIfExists() +8922512
System.Web.Compilation.BuildManager.Initialize() +495
System.Web.Compilation.BuildManager.InitializeBuildManager() +267
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +224
[HttpException (0x80004005): Could not load file or assembly 'App_Licenses' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8910703
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +333
--------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4223
ASP.NET c#怎么上传后服务器上打开出错呢? 本机上是没有问题的,现在不知错在哪里?请高手帮忙,谢谢!
------解决方案--------------------
bin文件夹的安全性增加 NETWORK SERVICE这个账户的读取权限
或者删除
%Windows Install Folder%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
下面的所有文件夹和文件再试试
------解决方案--------------------