Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am working on a console application in C#. I am getting this error"Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."...Its my data access layer which throw this error.

Any help is greatly appreciated.

Thanks.
Posted
Comments
Richard C Bishop 11-Feb-13 10:18am    
Do you have a reference to that in your project?
vidkaat 11-Feb-13 10:20am    
yes all the references are in there
Richard C Bishop 11-Feb-13 10:22am    
Ok, I usually remove the reference and the tag for it in the web.config and then add it again. Sometimes that does that trick.
vidkaat 11-Feb-13 10:24am    
Actually its a console application. I am working on data loader project. So my console application is calling my Business logic layer which inturn calls my DAL...So i am not able to understand where this error comes from
Richard C Bishop 11-Feb-13 10:29am    
That's right, your thread does say console, not sure why I said web.config, sorry. I still think it has something to do with a reference though.

Here you go, I found this:

Click Me![^]
 
Share this answer
 
Comments
vidkaat 11-Feb-13 11:07am    
I could not understand can you help me with more specific answers
Hi,

Microsoft.Practices.ServiceLocation comes from: http://commonservicelocator.codeplex.com

From the project description:

The Common Service Locator library contains a shared interface for service location which application and framework developers can reference. The library provides an abstraction over IoC containers and service locators. Using the library allows an application to indirectly access the capabilities without relying on hard references. The hope is that using this library, third-party applications and frameworks can begin to leverage IoC/Service Location without tying themselves down to a specific implementation.


Happy Coding.

Thanks.
 
Share this answer
 
v3
Comments
Jibesh 11-Feb-13 10:45am    
do not post the commercial link in your answer or any were in this site. You will be reported for abuse if you do so again. I have removed the commercial link from your solution. Thanks
vidkaat 11-Feb-13 11:04am    
What exactly do i need to change?I could not understand ur solution
Shubha_India 11-Feb-13 11:17am    
Download & install the library from the above link. It is actually mission from your project. That is why you get that error. After install take the DLL reference withing your project.
Jibesh 11-Feb-13 13:03pm    
This solution is copied from this link . do mention the link where you get the solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900