Link to home
Start Free TrialLog in
Avatar of nisarkhan
nisarkhanFlag for United States of America

asked on

urgent: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0

asp.net 2
using DAAB ver 2

i spent lot of my time trying to figure out what cause this error and still cluless

i have web project and dal project and i have reference in both dal and web project the following dlls and the dll is physicall in the bin folder.

Microsoft.Practices.EnterpriseLibrary.Caching.dll
Microsoft.Practices.EnterpriseLibrary.Caching.xml
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.xml
Microsoft.Practices.ObjectBuilder.dll
Microsoft.Practices.ObjectBuilder.xml

 

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

 Error Information
 Name  Value
Build Version 3.00.00 Build 1
Server  
UserID  
Source daab
Exception Type System.IO.FileLoadException
Message Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
StackTrace    at daab.LoginUserInfo_DA.GetLoginUserInfo(String userId)
   at Model.LoginUserInfo.GetLoginUserInfo(String UserId)
   at Global.Session_Start(Object sender, EventArgs e)
   at System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)
   at System.Web.SessionState.SessionStateModule.CompleteAcquireState()
   at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
TargetSite System.Data.IDataReader GetLoginUserInfo(System.String)

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

It is important to know what type of web project you have:  Web Application model (project file), or Web Site model (no project file).

What does the 'Build Version 3.00.00 Build 1' refer to?

This looks like you are trying to instantiate the class in the global.asax file.
Avatar of nisarkhan

ASKER

i'm usiing web site ... asp.net 2
the build version is a internal so ignore that part.
yes i'm trying   call the daab dll from the global.asax file in session start
Where are you getting this exception?  Development machine?  Server?
my local machine works fine but when i deploy to development machine i get the above error

i deploy through VS 2005 right click the web project and "Publish" and give the path to the development machine and i tried with checkbox and without checkbox (the first checkbox) but nothing changes

dunno what is going on

any thoughts?

thanks
What folder does the Microsoft.Practices.EnterpriseLibrary.Data.dll get copied to on the server?
Bin folder
i have two projects
1) DAAB
2) WEB project

in the DAAB i have all the dlls in the bin folder also i have reference

Microsoft.Practices.EnterpriseLibrary.Caching.dll
Microsoft.Practices.EnterpriseLibrary.Caching.xml
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.xml
Microsoft.Practices.ObjectBuilder.dll
Microsoft.Practices.ObjectBuilder.xml

and same for the web project except reference. and i have directly copied all the dlls in the bin folder

it use to work fine before and not sure what triggers this problema and i'm clueless now and i have done lot of reserach and no luck yet.

thanks for looking.
Do you have any rules in the web.config file that specify path rules, like  with deny or allow?
nope i dont have anything like that
i have this line in the web.config





What happens when you take out ?
i will try hold on
still the same
Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

i have the Microsoft.Practices.EnterpriseLibrary.Data.dll in the Bin folder of the development machine

not sure why its complaining???????????


eggrrrrrrrrrrrr
Do you have any special security set for the folders on the server?
my situation is bit strange and complicated....

i dont know about eh special security set for the folders and i have to talk to other person to know...

but here is the strange part

before i deploy my new version to development box i backup the old deploy files on my local machine and since the new deploy project is not working.. i thought to copy the old web project to development machine and its working without any problem....

i'm not understanding why and what i'm missing ....

thanks
What happens if you just file copy the web project to the server, to a new web site created as a test?
hmmm i thin i able to pin point the problem
if you look at my error and i'm connecting to db at the session_start and thats make everything break and not sure why but it is
i comment the session_start code thats connect to db and deploy the project and its work fine...

so question to you...

the reason i'm connecting to db on the session_start is whoever logins get the user-name (i''m using windows authentication) and get the more info of the user who login.....

what is the best practice in this scenario?

Hmmm...best practice, best practice, ...

Wait until you really need that information, get it then, store it in a Session variable.
do you know how would you do in this situation?

any advice or help ?

thanks
well.. i need that information before the page loads on i want to check if the user has roles to see this page or not so i dont see where else i will load the user info?

:confused:
1) I wouldn't use DAAB, since it requires an external reference.

2) If I was going to stick to Enterprise Library, I would go with version 3.

3) Also, I would think about an HttpModule.
ASKER CERTIFIED SOLUTION
Avatar of nisarkhan
nisarkhan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I lost track of this question.

An HttpModule can pre-process all request, and give you control over how your pages are authenticated.

How To Create an ASP.NET HTTP Module Using Visual C# .NET
http://support.microsoft.com/kb/307996