Click here to Skip to main content
11,704,768 members (44,943 online)
Rate this: bad
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=, 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 3:22am
Edited 22-Mar-13 3:53am
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,

1 solution

Rate this: bad
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.
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 Sergey Alexandrovich Kryukov 679
1 OriginalGriff 455
2 Andy Lanng 245
3 CPallini 242
4 Maciej Los 225
0 OriginalGriff 8,864
1 Sergey Alexandrovich Kryukov 8,245
2 CPallini 5,189
3 Maciej Los 4,726
4 Mika Wendelius 3,606

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 22 Mar 2013
Copyright © CodeProject, 1999-2015
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