I'm trying to compile WebKit .NET 0.5 in VS 2010 Professional but I'm getting the error:
"Could not load file or assembly
'C:\Users\Juan
Luis\Desktop\WebKit.NET-0.5-src\bin\Debug\WebKitBrowser.dll'
or one of its dependencies. The system
cannot find the file specified."
I tried removing the WebKitBrowserTest project from the solution but now I'm getting
"The type or namespace name 'WebView'
could not be found"
errors everywhere. Any idea what am I doing wrong?
replace the .dll in the projects debug folder with the original .dll's. When VS make a copy of the .dll's, it does something wrong, replacing them should fix the problem.
Try to copy '\WebKit.NET-0.5-src\bin' to your 'bin' folder.
With me, I can't build whole solution, but it runs when I select WebKitBrowserTest as StartUp project, then Ctrl + F5 (Visual Studio would ask me for rebuild JSCore, just click Yes).
If you see an error like "Retrieving the COM class factory for component with CLSID...",this link can help http://dotnetgenetics.blogspot.com/2013/06/retrieving-com-class-factory-for.html
Related
I am receiving an error when I try to compile my c# source code file on my Mac. Normally I compile my source code using the mcs command on a bash terminal window and it compiles fine. But, this one particular project requires the installation of the NuGet package 'MySql.Data'. This has resulted in the following error message:
error CS0246: The type or namespace name 'MySqlConnection' could not be found. Are you missing an assembly reference?
I have tried to follow numerous solutions online to try and add the assembly reference, but my IDE just does not look like the help documentation's screenshots.
I have tried to Edit References, but no references appear. I tried to manually download the MySql.Data.dll (v.6.3.5.0) but I think it is for an outdated version of the MySql.Data class library as it does not work. Even after cleaning the code and rebuilding it.
Edit: I have also tried to add the dll that was included in the project folder but it said it could not locate the assembly (even though they are both in the same project folder).
Could not resolve this reference. Could not locate the assembly "search_feature". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. (MSB3245) (search_feature)
Edit 2: I renamed the dll file from the project bin folder to MySql.Data.dll and I no longer get the error. But it still won't compile.
The code works fine when run in Visual Studios for Mac, but I just can't compile it. Any ideas how to add the assembly reference?
I am using the most up-to-date version of Visual Studios:
Visual Studios for Mac Community 7.5.4 (build 3)
I have tried uninstalling and reinstalling Visual Studios for Mac.
My code has the library reference at the top: Using MySql.Data.MySqlclient; and the project runs. It just won't compile.
I'm having an issue building a project that references a DLL located in the project's bin folder, which up until yesterday was building and running without issue.
The error I'm getting is fatal error CS0009: Metadata file 'c:\MyProject\bin\myClient.dll' could not be opened -- 'Error importing module 'myClient.netmodule' of assembly 'c:\MyProject\bin\myClient.dll' -- The system cannot find the file specified.' Intellisense is similarly complaining that The type or namespace 'Api' does not exist in the namespace 'Client' since it can't find the DLL.
Let me know if you think this is a duplicate, but I've viewed several similar posts and the solutions did solve my problem. Here are some examples:
Visual Studio 2010 — are you missing a using directive or an assembly reference?
VS2010 - Getting “type or namespace name could not be found” but everything seems ok?
Stymied by ASP.NET Compilation Error CS0009
Metadata file '…\Release\project.dll' could not be found in Visual Studio
Visual Studio 2010: Metadata file “…/Debug/Graph.dll” could not be found
Metadata file … could not be found error when building projects
Specifically, I've tried the following solutions (and combinations of these):
Cleaned and rebuilt my project.
Made sure that the target framework is not a 'client profile' version of .NET
Verifyied that the dll has been added as a project reference
Removed and re-added the project reference
Verified that the project is showing the DLL in the References section in Visual Studio
Repaired .NET
Verified the location of the DLL (it is in the local project's bin folder as given by the error)
Tried other versions of .NET
Closed and restarted Visual Studio
Rebooted my machine
Verified there are no hidden characters surrounding the 'using' statement
Removed all code changes since the last working build
Verified the settings in Configuration manager, including that 'Build' is checked
The project calling the DLL is a small class library that resides in a solution with one other small project (a console application). The DLL is an external DLL that I've been using successfully for several weeks in this project/solution. The error arises regardless of whether I build the project from the solution or by itself.
Any ideas about what could be going on?
Have you included bin folder in your project accidentally? If yes that might cause the issue. You can't include bin folder in your project as the bin folder will be created by the VS. If you accidentally include bin folder in your project, the bin project will be set to Copy to output which when you compile, the file is deleted and copied to output by Visual Studio that trigger weird behavior that some file is missing.
Hopes this help
Well I'm not sure exactly what happened here, but here is what finally resolved the issue:
A good-old-fashioned delete every single file and rebuild the project from those files from scratch. I gave +1 to some of the responses because they were useful to consider, and because there was probably a messed-up reference some where as Jonathon Wood suggested.
I have problem with build in VS2010. I´m trying to develop small Prism, MVVM application.
I added new project "Toolbar" to my solution "MyApp" and during the build I get following error (propably project´s dll is not created for some reason):
Error 2 Could not load referenced assembly
"C:\net\projects\MyApp\MyApp.Modules.Toolbar\bin\Debug\MyApp.Modules.Toolbar.dll".
Caught a FileNotFoundException saying "Could not load file or assembly
'C:\net\projects\MyApp\MyApp.Modules.Toolbar\bin\Debug\MyApp.Modules.Toolbar.dll'
or one of its dependencies. The system cannot find the file
specified.".
C:\net\projects\MyApp\MyApp\ResGen MyApp
I´m quite new to VS2010 and C# so I really don´t know what happend, wheter project dll is missing because of some mistake in source code or why this can even happend? I also don´t know how to find such a mistake in source code, because VS shows up only the error mentioned above. Dependenies of the project should be ok i guess, file MyApp.Modules.Toolbar.dll really doesn´t exist in any folder on my hdd.
The problem was the bad class name defined in xaml of Toolbar project (UserControl x:Class="BAD CLASS HERE").
After many googles for a similar problem where I had at one time toyed with using open office in a .net project and then all my aspx pages had the blue squiggely line saying cli_uno couldn't be found which was referenced no where and in none of my project or lib files.
I deleted all the bin folders, a dll referencing it was hiding in one of them and making vs2010 freak out.
I realize this isn't the exact solution to the above but there isn't much out there for this error and it is a head scratcher and deleting all the bin folders worked for me so it's something to try.
You provide too litle information, so I'll ask some questions (and some possible fixes):
Is the file at the specified path to begin with?
If not, is there a project you need to build to create the dll?
If there is such project, does it build the .dll where yours is looking for it -- if not, you either need to copy it by hand or set up a post-build process to do the copy automatically after each build
If there is no such project, do you have the .dll itself somewhere. If yes, you need to copy it to the correct location.
If the .dll is at the correct location, is there some protection preventing the other project to access it?
Inherited C# win form application - VS .NET 2008.
Project builds with no error.
Navigate to display main dialog in the IDE and error screen displays with the error.
The .dll is in the bin directory. Also, under the "References" tree in project viewer with correct path.
(All supporting files/dlls should be here.)
Any ideas how to fix this?
EDIT 1 started Fuslogvw.exe does not have anything listed. Is there something else I need to do to get this error to display here?
EDIT 2
Running "Dependency Walker" and it comes up with the error:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
unable to open 2 windows system32 dlls....
I decided to answer this question because
I'm looking for the anwser myself and this ranks high in google search yet it is unanswered, and
The "possible duplicate" do not help solving my problem.
OK, here is a recap of my situation, which you can see almost identical to OP:
C# project/solution - VS .NET 2013.
Project builds with no error.
The reference .dlls are in the pre-defined directory.
Also, under the "References" tree in project viewer, it shows the correct path.
Yet, Visual Studio complains (at run time):
Could not load file or assembly xxxxxx, Version=x.x.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx or one of its dependencies. The system cannot find the file specified.
I found the solution from here,
http://blogs.msdn.com/b/asiatech/archive/2013/01/09/how-to-resolve-the-could-not-load-file-or-assembly-issues-on-windows-azure-web-sites.aspx
I.e., In Visual Studio,
Find the referenced assembly in “Solution Explorer”, e.g.,
Microsoft.WindowsAzure.StorageClient
In the “Properties” window, set the “Copy Local” to “True”.
It might not be the ideal fix but it solved my problem. If it helps you as well, please +1 (vote up). Thanks.
For about 2 weeks now, I have been unable to run any UnitTests (built in VS unit tests) for a project. Previously everything worked fine. The error message is:
Could not load file or assembly 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\MyProjectName.XmlSerializers.dll" or one of its dependencies.
The project references System.Xml.Serialization and uses the XmlSerializer class; just like many other classes/projects I've written. For some reason, only this project is affected. It builds fine, runs fine, I just can't run my unit tests.
I've checked the directory, and all the dlls in that directory are Microsoft dlls. The dll that it is looking for obviously is not a Microsoft dll.
Anyone have any ideas?
Edit:
It apparently has something to do with using the XmlSerializer and it generating that file automatically instead of using sgen.exe. Here is a link to the MSDN article. From what I've been able to find, it has something to do with using the serializer with generics. None of the sources I've found seem to offer any way to make it actually work.
First enable loader logging (using FUSLOGVW.exe from the SDK) to confirm what is not being found.
Then use Reflector on all your assemblies to find the one that is trying to load the non-existent assembly. If you find no such assembly it must be being loaded dynamically, in which case attaching to AppDomain.AssemblyResolve should allow you to identify where.
try to copy all your source files somewhere, then delete the project and try to make it from scratch. Maybe something happened with project dependencies
Is your computer 64bit? I got the same error when trying to run a 64bit dll with NUnit that was set to work as an x86 assembly (using corflags).
You can probably find out from the error message (use FUSLOGVW.exe lick Richard suggested).
If that is the case you can either sent the dll or NUnit to run as the correct assembly using corflags.
Solution
As it turns out, the problem was with VMWare. I installed the latest version of VMWare, and it installed it's tools to debug in a VM. Something it installed or changed caused this problem. When I uninstalled VMWare, the problem went away. So, I reinstalled VMWare without installing it's debugging capabilities and the problem did not come back.
Workaround:
I still have no idea why this problem suddenly started occurring, but I found a hack to make it work.
I had to go to project properties => Build Events and add this line to the Post-build event command line:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" "$(TargetPath)" /force
This forces VS to generate the file. I then had to copy that file manually to the directory it was looking for it in:
"C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies"
Now it I can run my tests and step through them. The problems I have now are 1) I have to remember to copy the dll to that directory every time I change something in the classes that I am serializing, and 2) I now get a ThreadInterruptedException when a test finishes running; thus 3) I can only run one test at a time.
Not a good solution, but at least I can limp through. Unfortunately, redoing everything, as Nikita Borodulin suggested, is not an option.