views:

409

answers:

4

When I am trying to debug in visual studio 2008, im getting the following error. I have cleaned the asp.net temp folder and restarted VS. I also removed the supposedly breaking reference and added it back. But nothing seems to working. Has anyone faced similar situations and is there a solution.


Could not load file or assembly '"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

[FileLoadException: Could not load file or assembly '"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)] System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent) +0 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +114 System.Reflection.Assembly.Load(String assemblyString) +28 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly '"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +8809426 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +128 System.Web.Compilation.BuildManager.CompileCodeDirectories() +265 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320

[HttpException (0x80004005): Could not load file or assembly '"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729

[HttpException (0x80004005): Could not load file or assembly '"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8890735 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259

+3  A: 

Assembly loading issues are something all .NET developers need to learn to fix. There are a number of possible reasons, to work out the problem there are two things you need. First understanding how .NET finds assesmblies. Second the Fusion Log Viewer (Fuslogvw.exe), which with the knowledge of the loading process will allow you to identify what is working and failing.

Usually the reason to getting a load exception is that the assembly you want is not in the GAC or probing path. It can also be due to the target assembly not being built for the neccessary platform (e.g. a 64bit process cannot load an assembly built for "x86" only).

Richard
A: 

That does not look like a very good assembly name, but if in fact it does exist...

It seems that you are manually specifying this assembly somewhere, perhaps in web.config?

if so, try using the Assembly Qualified Name, an example would be found in your web.config for any assembly that microsoft places there. Do not worry about version/culture or key, just "type name, assembly name" will usually suffice.

e.g. instead of:

'"GCS.Common (asif mohammed's conflicted copy 2010-01-29)"

use

'"GCS.Common (asif mohammed's conflicted copy 2010-01-29), [insert assembly filename less extension here]"

p.s. my advice is to name assemblies using the same rules as identifiers in c#. your life will be easier in the long run.

Sky Sanders
A: 

Completely agree with Richard...
Just one more hint: reading the exception trace I think that "GCS.Common (asif mohammed's conflicted copy 2010-01-29)" is a very strange name for an assembly, isn't it? ;-)
Did you rename some file, perhaps in the bin folder?

Fabrizio C.
i using version control so , the part in () maybe from that
Shishya
A: 

I was right. It was something that my version control software caused. When i got the latest version it somehow added an additional copy of all my assemblies with (asif mohammed's conflicted copy blah blah), after almost thinking about reinstalling in VS i just had to remove the sneaky dlls sitting in my file system.

Thanks for all the responses. Learned how to assembly loading works, so all is not lost.

Thanks

Shishya