Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load file or assembly

When I am trying to debug in Visual Studio 2008, I'm 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 work. 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

like image 635
Asif Mohammed Avatar asked Feb 14 '10 10:02

Asif Mohammed


People also ask

How do you fix Could not load file or assembly or one of its dependencies?

There are some workarounds for this issue: The dll file may not be in /bin folder. Just copy the dll file to /bin folder or set this preference Copy Local = True from Visual Studio. If the problem persists, check if the version of the assembly that is referenced is different than the version it is looking for.

Could not load file or assembly but it is there?

Web. Http 5.2. 0.0? In summary if you get the "Could not load file or assembly error", this means that either your projects or their references were built with a reference to a specific version of an assembly which is missing from your bin directory or GAC.

Could not load file or assembly VS 2019?

Restart Visual Studio, clean and build a solution. Remove the class library references and add it again. Tools > Import and Export Settings Wizard > Reset all settings (maybe some setting was not well configured).

Could not load file or assembly culture neutral Publickeytoken null the system Cannot find the file specified?

This error usually means that the assembly was not found. Try verifying that the file exists in the directory where your application is running.


1 Answers

" * * * * * * * * 's conflicted copy with #### - ## - ## "

Seems like you are using dropbox to sync files, this "conflicted copy" files dropbox creates if 2 computers changes the same file offline.. and when they get online dropbox sync algorithms confuses which file is the right one so it keeps both files with renaming one to this name pattern.

In your case:

this happened inside your project's bin directory, just delete the file with "conflicted copy" part and keep the other one.. OR delete both if your project reference the dll from another location, and Rebuild the solution.

like image 117
alaasdk Avatar answered Oct 05 '22 17:10

alaasdk