Could not load file or assembly Temporary ASP.NET Files

廉价感情. 提交于 2019-12-04 01:34:01
Jan Remunda

I had simmilar problem after i tried to start performance tests. I removed assemblyPostProcessorType attribute in system.web > compilation element in web.config and it worked again.

 <system.web>
<compilation debug="false" targetFramework="4.5.1"  
            assemblyPostProcessorType="Microsoft.VisualStudio.Enterprise.Common.AspPerformanceInstrumenter, Microsoft.VisualStudio.Enterprise.AspNetHelper, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</system.web>

If you use Visual Studio Performance Tools then it is possible that Visual Studio left a key in your web.config appsettings section. It causes a 32 bit library to load, which won't work if your application is loading in 64 bit mode.

Check for the following and remove it:

<add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Team Tools\Performance Tools\vsinstr.exe"/>

One of the solution is to delete those files from temporary asp.net folder that always works for me.

Sarrus

Here you have similar problem I think: Could not load file or assembly 'file:///C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ asp.net vs2010

accepted answer was:

Try performing a full solution build. If that doesn't work, click Build -> Clean Solution. If the error persists, delete everything in the C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\parktms folder and repeat.

In my case while deploying an ASP.NET MVC project I renamed the DLL of one of the projects (the Assembly Name) in Visual Studio application properties.

Inside the Views folder of the ASP.NET MVC project sits a Web.config file. This Web.config file has the following razor section where we can list assemblies for nice IntelliSense support in Razor view files:

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="VizionLogs.LogRepository" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization"/>
        <add namespace="System.Web.Routing" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>

My problem: I renamed the project assembly from VizionLogs.LogRepository to ITVizion.VizionLogs.LogRepository and forgot to rename it in that Web.config file. This was causing that ASP.NET Temp folder error telling me it could not find VizionLogs.LogRepository. It took me some time to figure out what was going on and where the error was... :)

Go to Registry and enter

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion]
"EnableLog"=dword:00000001
"LogFailures"=dword:00000001
"LogPath"="c:\\temp\\fusionLog"

For loaded assembly you will find a log in c:\temp\fusionLog

There you will find what dependency is missing.

I had same problem. I just solve it by changing on web.config -> system.web -> compilation -> debug="false". Then it work fine

removing temporary projects files in corresponding folder like for .net 4 from below folder will resolve the issue.

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files"

also refer to this answer.

Answered by Tommy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!