System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET

Matthew Ikechukwu 20 Reputation points
2024-09-29T19:36:14.8666667+00:00

Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\6626fd2f\24c72bd9\App_global.asax.i5a4lpe2.dll' or one of its dependencies. The system cannot find the file specified.

Visual Studio 2019 generated this error when compile a project

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,480 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lan Huang-MSFT 29,331 Reputation points Microsoft Vendor
    2024-09-30T02:50:24.5833333+00:00

    Hi @Matthew Ikechukwu,

    First try running Visual Studio as an administrator. Just right-click the Visual Studio icon and click Run as Administrator.

    If the error persists, try the following:

    • Try performing a full solution build. If that doesn't work, click Build -> Clean Solutionand republish to the server.
    • Close Visual Studio and stop the IIS website, then delete the temporary project files in the corresponding folders below:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
    • If you are using performance testing, you will need to remove the assembly PostProcessor Type attribute in the system.web>compiler element in web.config.
        <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"/>
      

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.