Forum guidelines
  • Home
  • »
  • C# Language
  • »
  • Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
AuthorQuestion
Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 12 Feb 2011
Hi, I did a server/client program in c# and I couldn't get it started, 'cause when I click "run", this error pops up.
p.s: it's my first time I do server/client in c#/
Need help. Thanks.

AuthorReply
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 13 Feb 2011  

Marat,

Without providing more information we cant help you. List what you are doing and at what point the error getting.

Also, check you are using the latest version of assembly. Remove all the references from bin/.config files etc.

Add the correct assembly version.

Mark as Answer, on the posts reply's that helped you !!!.
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 13 Feb 2011  

What error? You don't tell us what the error is.

Thinking is a feeling; pleasant for some and unpleasant for others.
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  
As I said, I did a simple client/server program, and my objective is to make a multithreaded data base that runs on a server, when any client can use that data base.
The error occurs ("Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT ") when I click the green button "Run" in the toolbar of VS, in order to run the server.

Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  

Which HRESULT error number you getting.
Try, remove all temporary files.
 

Mark as Answer, on the posts reply's that helped you !!!.
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  
The error number is: 0x80131047
What temporary files?

Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  

Marat,

The project is developed on which framework?

This issue also occurs when a 1.1 framework project tries to run with 2.0 framework. Some major assembly version get missing.

Also refer msdn

Mark as Answer, on the posts reply's that helped you !!!.
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  
May be it's a silly question, but how I know what framework I use?
I know that I use VS 2008 that's all.

Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  
Oh, now I see that you put the error message in the subject but not the body. It really helps to put everything in the body; anything you put in the subject should also be in the body of the message. When I go through the threads, I usually open many at a time. I use the subject to help me decide what to look at that I might be able to help with, but by the time I read the questions, I have forgotten what the subject says.

As for what version of the .Net Framework that you are using, look in the project properties. The project is probably set to use 3.5 so the version is not likely the problem.

The problem might be difficult to diagnose; especially for someone unfamiliar with .Net and Visual Studio. It is difficult to suggest a way to diagnose the problem. It is probably caused by something you did but it is difficult to guess what that is. You can look at Troubleshooting 1935 and 2908 errors during installation - Aaron Stebner's WebLog but that might not be relevant to your situation and even if it is, it is likely too advanced for you.

Thinking is a feeling; pleasant for some and unpleasant for others.
Re: Could not load file or assembly or one of its dependencies. The given assembly name or codebase was invalid. exception from HRESULT
Posted on: 14 Feb 2011  
if it can help, I can put here my project, maybe it will help you solve my problem.

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.