Error: could not load file or assembly or one of its dependencies

S

Sheila

Hi,

Does anybody encounter this error:
Unhandled Exception: System.IO.FileLoadException: could not load file or
assembly or one of its dependencies. Access is denied.

I google the error and found a few resolutions, such as exclude Temporary
ASP.NET Files folder from virus scan, grant full rights to Temporary ASP.NET
Files folder, etc. all doesn't work.

Previously the application works fine if all dlls are deployed in GAC, but
after I move dll to application Bin folder, the problem happens. To make the
website up, I have to clear all content in Temporary ASP.NET Files folder,
but after a few runs, it happenes again. Right now the only soultion works
for me is to set trust level to full in web.config, which I don't want to do
due to security reason.

Does anybody know what could be the cause? thanks in advance.
 
M

Michael Nemtsev [MVP]

Hello Sheila,

How do u refer to your dll? could you post the code how u declare and use
your dll?



---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> Previously the application works fine if all dlls are deployed in
S> GAC, but after I move dll to application Bin folder, the problem
S> happens. To make the website up, I have to clear all content in
S> Temporary ASP.NET Files folder, but after a few runs, it happenes
S> again. Right now the only soultion works for me is to set trust level
S> to full in web.config, which I don't want to do due to security
S> reason.
S>
 
S

Sheila

Hi Michael,

The website is hosting a few customized server controls, thus its difficult
to post all code here. I just show you how a assembly (common library) is
normally called in the code

....
using Company.Common;

....
CommonFunction Com = new CommonFunction();
if (Com.IsCorrectCategory(output, NewsCategories))
{
PageList = ContentPublishing.GetAllPageList(SiteID,
Com.GetNewsCategoryID(SiteNewsCategory,NewsCategories).ToString(), null,
_startDateTime, _endDateTime);
}
...

Is there any article I can read on this? thanks.

Regards
Yu Ping
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top