I'm using asp.net mvc 4 in my project, but there are some assemblies that are trying to find 3.0.0.0.
Project works fine on my development machine, but throws an error "Could not load System.Web.Mvc version 3.0.0.0" on the server.
Also, I see the warning in my Visual Studio
Found conflicts between different versions of the same dependent
assembly. In Visual Studio, double-click this warning (or select it
and press Enter) to fix the conflicts; otherwise, add the following
binding redirects to the "runtime" node in the application
configuration file:
I don't want to add binding redirect in my web.config, I want to update the assembly that depend on older version of system.web.mvc to the newer one, but I have no idea what is the name of that assembly. How can I know that?
Delete the reference to System.Web.Mvc in the Solution references. Then add only the reference of MVC Ver 4.0 Dll from project folder path - \packages\Microsoft.AspNet.Mvc.4.0\lib\net40.
Once you compile the project, It will list out the controller or views which are not compatible with MVC 4.0. You can identify the assemblies based on error details.
Related
I have been tasked with converting an old .Net 2.0 application to 4.0 and am running into a build error related to a missing dependency.
The build error is as follows:
Error 1 Could not load file or assembly 'Atalasoft.dotImage.Ocr.GlyphReader.DLL' or one of its dependencies. The specified module could not be found.
I was thinking that I needed to find a newer version of this DLL but I wanted to see if anyone knew an easier method for resolving this first.
Any help would be great!
A .NET 4.0 or later assembly can reference and use an assembly built on the .NET 2.0 framework. The problem is that the compiler cannot find the assembly, not that the assembly is the wrong version. Try the following steps, this should clear up your problem:
Highlight the reference in the project and go the the properties tab (F4 shortcut). Check the path that is used to reference the assembly and verify that it is actually located there.
Check if the project requires a specific version of the assembly. Go to the same properties page like mentioned in step 1 and see if specific version is set to true, change it to false if this is not a requirement for you.
If you are using NuGet ensure that the latest assemblies have been downloaded if you are not persisting your references to the source repository. You check this by going to the nuget project references and in the top right corner there will be a message asking you if you want to restore all package references if they cannot be found.
If you are not using nuget for this and it still does not work then remove the reference and manually re-add it to the project.
I'm currently making an extension for Spotfire that embeds a web browser (CefSharp) into the application. However, when I attempt to run the package, I get the error:
"Package 'D3Visualizations' has unresolved assembly references:
'CefSharp, version 1.25.4.0' is referenced by 'D3Visualizations.dll'."
I've added CefSharp.dll and CefSharp.WinForms.dll as references, and I have added those two as well as icudt.dll and libcef.dll into the bin/Debug folder.
I honestly don't know why it doesn't work right now; the last time I got an error in the package builder like this, it was due to .NET version mismatches.
What am I doing wrong? I'm using Visual Studio 2013 Express Desktop, and the project is in .NET framework 4.5.1.
Can you check the path for the references in their properties window? You can try removing and re-adding the references to the dlls in your bin folder and set Copy Local = true. If that doesn't work try setting it explicitly in the project file as in this question: Force VS to reference local dll
Well, I'm not familiar with C#. Here's my story:
In the VS2010 solution, there are 2 projects: Entrance, Core and Plugin. Entrance may be compiled into an exe, while the others may produce dlls. Core is added to Entrance's and Plugin's reference. Plugin is set to be compiled to plugin folder. So after compiling, the output directory contains:
entrance.exe
core.dll
plugin\core.dll
plugin\plugin.dll
How can I remove the duplicate core.dll under plugin? Thanks.
In the Solution view of the plugin project, right-click on the core.dll reference and select Properties. Set Copy Local to false to prohibit copying of the assembly to the output directory. Note this will only work properly at runtime if the referenced assembly can be found by the application. In your case it's fine since core.dll is also referenced my the application but that might not always be so.
I'm working on a C# 4.0 project in VS2010 and needed to use some older DLLs containing controls that were created in C# 3.5 on VS2008. When I first add the DLLs to the references, I was able to see the namespace via intellisense and create an instance of one of the controls, but when I go to build, it gives me the following error:
The type or namespace name 'BCA' could not be found (are you missing a using directive or an assembly reference?)
And I do have a using directive for that namespace already, which is now underlined in red, showing that VS cannot find it. And now, intellisense won't pick up that namespace at all.
I even tried added the controls to the toolbox (which worked) but then when I drag them to the GUI, it says that it cannot locate the DLL reference, even though it obviously knows where it is.
I even tried changing the target framework to 3.5, but still with the same results.
Any thoughts as to why this could be happening?
Edit - I've notice that in the csc.exe arguments that VS outputs, it does not have any /reference entries for the DLLs I'm trying to use. When I create the same basic project in VS2008, those entries exist. Also, I can successfully reference the DLLs in a DLL project in VS2010... it seems to just be WinForms projects that don't work.
Turns out that it was something to do with VS2010 defaulting to the .NET 4 client profile, as soon as I changed it to the regular profile it built fine. There's a day wasted...
view the target framework.. in my project, was 4.0 client profile, e the reference dll was in 4.0
I tried Build->Clean Solution and then could add the reference.
I used to have similar problem, but the profiles were not the issue, so the problem was that my class library use a special NuGet package that has Dependency... so I install the dependency package in the target project and added the project reference and works!
But I am not sure if there is a better solution for this problem??? for me VS should be smart enough to carry those dlls along with the references. (I already verified that "Copy Local" is set to True)
I'm working on a C# 4.0 project in VS2010 and needed to use some older DLLs containing controls that were created in C# 3.5 on VS2008. When I first add the DLLs to the references, I was able to see the namespace via intellisense and create an instance of one of the controls, but when I go to build, it gives me the following error:
The type or namespace name 'BCA' could not be found (are you missing a using directive or an assembly reference?)
And I do have a using directive for that namespace already, which is now underlined in red, showing that VS cannot find it. And now, intellisense won't pick up that namespace at all.
I even tried added the controls to the toolbox (which worked) but then when I drag them to the GUI, it says that it cannot locate the DLL reference, even though it obviously knows where it is.
I even tried changing the target framework to 3.5, but still with the same results.
Any thoughts as to why this could be happening?
Edit - I've notice that in the csc.exe arguments that VS outputs, it does not have any /reference entries for the DLLs I'm trying to use. When I create the same basic project in VS2008, those entries exist. Also, I can successfully reference the DLLs in a DLL project in VS2010... it seems to just be WinForms projects that don't work.
Turns out that it was something to do with VS2010 defaulting to the .NET 4 client profile, as soon as I changed it to the regular profile it built fine. There's a day wasted...
view the target framework.. in my project, was 4.0 client profile, e the reference dll was in 4.0
I tried Build->Clean Solution and then could add the reference.
I used to have similar problem, but the profiles were not the issue, so the problem was that my class library use a special NuGet package that has Dependency... so I install the dependency package in the target project and added the project reference and works!
But I am not sure if there is a better solution for this problem??? for me VS should be smart enough to carry those dlls along with the references. (I already verified that "Copy Local" is set to True)