Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got the error:
HTML
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...

What could be the reason for this error. I tried to google it....But it didnt solve my issue. My reference version seems to be the same...

Any help is greatly appreciated.
Posted
Updated 22-Mar-13 3:53am
v2
Comments
[no name] 22-Mar-13 9:26am    
The error is fairly obvious isn't it? The system can't find the file. Did you deploy the file with your application? Did you deploy all of the files dependencies with it?
vidkaat 22-Mar-13 9:38am    
I did..
[no name] 22-Mar-13 10:11am    
Well apparently you did not. Otherwise you would not be getting the error right?
Dave Kreskowiak 22-Mar-13 10:38am    
Did you install the entire library or just copy the one .DLL?? Chances are good you copied just the .DLL. If that .DLL has dependencies on other library components, it'll throw this error. You have to deploy the entire library, not just one little piece of it.
vidkaat 22-Mar-13 9:38am    
I did...

1 solution

Tell us more about your application then we might be able to help you resolve the problem.

Any dlls that are listed in the References section of your application need to have their Copy Local property set to True except when the dll is part of the .Net framework or it's a dll that is part of other software that's already installed on the computer where your app will run.
 
Share this answer
 
Comments
vidkaat 22-Mar-13 11:25am    
My application is a Data loader. Its basically referencing the BLL which in turn reference DAL.
In my application i read the path of the file which is placed in my local folder is loaded into the database. I get this error wen i change my app.config very frequently..Let me know if you need more info...Thanks
phil.o 22-Mar-13 13:06pm    
"In my application i read the path of the file which is placed in my local folder is loaded into the database."

This is unclear. You mean that you read a local path, store it in a database, move your app on another machine, and try to load the file from the databse-stored value ? Why ?
vidkaat 22-Mar-13 11:41am    
Copy Local Property is set to true..But still i get the error..

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