locked
Strange Error Message and Stranger Solution: Could not load file or assembly . . . RRS feed

  • Question

  • User-748031297 posted

    VWD 2008 Express.  Visual Basic.

    I added the library Microsoft.Office.Interop.Excel to my project.  It is used in one page of my web site.  When this page comes up, it works just fine.  Moreover, most of the other pages on my site come up just fine.  However, when I tried to bring up another two pages on my site (pages which do not use Microsoft.Office.Interop.Excel) I got the following error:

    Microsoft.Office.Interop.Excel . . . Could not load file or assembly or one of its dependencies. Access is denied.

    I did a search on the net for this error and found a solution.  It worked for me, but I am not sure why it did and why I was getting the error to begin with, especially since the pages that errored out did not reference anything from the library (and worked fine before I added the Interop.Excel stuff to another page).  The "solution" follows.  Anyone able to help me understand this nonintuitive fix?

    This is one of the most irritating build errors a developer might see, especially while setting up an existing .NET application on a fresh machine. I have found one solution that works always. Go to "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" ( Modify the framework version, root directory etc according to your environment. ) Now, right-click and open up the Security tabs for this folder. Grant "Full control" to the 'users' group. (Modify will also work, thought I didn't try it out) However, it this is a security problem for your environment to grant full control to all users in Users group, another Solution could be to put the concerned assemblies lo GAC which I avoided as it was not  logical to put the assemblies into GAC in my scenario. Hope this helps.

     

    Tuesday, August 5, 2008 8:23 PM

Answers

  • User819135906 posted

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

    is the location and you may need to stop iis to delete them all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 7, 2008 12:33 AM

All replies

  • User819135906 posted

     i had the similar problem but it was fixed by deleting the temporary asp.net files

    Tuesday, August 5, 2008 11:30 PM
  • User-748031297 posted

    What temporary files are you speaking of and where are they located?

    Wednesday, August 6, 2008 7:53 AM
  • User819135906 posted

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files

    is the location and you may need to stop iis to delete them all

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 7, 2008 12:33 AM