Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
I got the 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...
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 22-Mar-13 4:22am
vidkaat530
Edited 22-Mar-13 4:53am
v2
Comments
ThePhantomUpvoter at 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 at 22-Mar-13 9:38am
   
I did..
ThePhantomUpvoter at 22-Mar-13 10:11am
   
Well apparently you did not. Otherwise you would not be getting the error right?
Dave Kreskowiak at 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 at 22-Mar-13 9:38am
   
I did...
ryanb31 at 22-Mar-13 9:55am
   
The system can't find the file, either because it isn't there or because permissions are not high enough.
vidkaat at 22-Mar-13 11:08am
   
Where shud i look for it?
ryanb31 at 22-Mar-13 11:21am
   
See solution 1. It will need to be in your bin folder of your app and for that to happen you should set your reference to Copy Local.
vidkaat at 22-Mar-13 12:18pm
   
Yes i did and i could see the dll in the bin folder i have set.But still i get this error.
ryanb31 at 22-Mar-13 12:28pm
   
Then possibly you have a permissions issue or is it a 64 bit /32 bit issue?
vidkaat at 22-Mar-13 12:30pm
   
32 bit machine is mine....I tried changing the Read -only property of the bin folder...Nothing seems to work....Any other suggestion will be greatly helpful.Thanks.
ryanb31 at 22-Mar-13 12:33pm
   
Is this error on your machine or on a server?
ryanb31 at 22-Mar-13 12:34pm
   
Here's where you can download it, http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/21bf388e-cb28-4e4f-854c-5a992295203c/

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
vidkaat at 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 at 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 at 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)

  Print Answers RSS
0 BillWoodruff 360
1 Mathew Soji 309
2 DamithSL 225
3 Afzaal Ahmad Zeeshan 202
4 Maciej Los 190
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web01 | 2.8.1411019.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100