I was working on VS2013 on a class library project that references MVC dll from the following location:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll
Then I uninstalled VS2013 then installed VS2015. Now my project is demanding the MVC dll
Please note that the following path:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\
is missing from my computer.
The following compile error appears on build:
Severity Code Description Project File Line
Error CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
My guess would be that MVC4 was bundled together with visual studio 2013 and thus is also removed. You could try to reinstall it yourself using the web platform installer or removing the dependencies and re-adding them using nuget (https://www.nuget.org/packages/Microsoft.AspNet.Mvc/4.0.40804) Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804
Related
CICD TFS 2013 - Nuget auto restores on TFS Serer MSbuild(not in Visual Studio):
I added NuGet.config file on a solution folder. but auto restores NuGet on TFS Build it's not worked.
Error:
enter image description here
$/Core/testCICD/Webtest/Webtest.sln - 5 error(s), 1 warning(s), View Log File
Default.aspx.cs (8): The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Default.aspx.cs (9): The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Model\Account.cs (1): The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
Model\Account.cs (12): The type or namespace name 'JsonProperty' could not be found (are you missing a using directive or an assembly reference?)
Model\Account.cs (12): The type or namespace name 'JsonPropertyAttribute' could not be found (are you missing a using directive or an assembly reference?)
C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets (1697): Could not resolve this reference. Could not locate the assembly "Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
CICD TFS 2013 - Nuget auto restore on TFS Serer build
According to the error message, it shows you have use the Newtonsoft.Json, Version=12.0.0.0 in your project.
AFAIK, starting from Newtonsoft.Json 9.0.1, this package supports the targets framework .NETStandard:
https://www.nuget.org/packages/Newtonsoft.Json/9.0.1:
Which is supported by NuGet 2.12.
So, to resolve this issue, you should make sure the nuget.exe version is higher than 2.12 and the Visual Studio version is high than 2013.
To resolve this issue, you could update Visual Studio 2013 to Visual Studio 2015 and above, then use MSBuild task to specify the MSBuild 14.0 (or above) to build your project.
Or you could use the Newtonsoft.Json 8.0.3 instead of 12.0.x in your projects.
I have an ASP.Net MVC3 Project which references System.Web.Helpers v2.0 and System.Web.WebPages v2.0 These both come with MVC4 and is part of razor2. However, my colleague doesn't have MVC4 installed, and doesn't have VS2012 installed, just vs2010 like myself. And his project compiles without the reference issue.
Visual Studio 2010 SP1 installed: Version 10.0.40219.1. SP1Rel
I recently installed Windows 8 on a new PC but our project requires vs2010 and can't run on vs2012.
This project was working fine on another PC which had vs2012 installed.
The new PC has:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0 but not:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0
but my colleague has the latter folder and the v2.0 assemblies - without MVC4, and without vs2012 installed. How is this possible?
Download it from here, use nuget console :
https://www.nuget.org/packages/Microsoft.AspNet.WebPages/2.0.30506.0
How is this possible? --
After a lot of hit and miss, I found out that my colleague has Microsoft WebMatrix. This product when installed happens to implement razor v2 and installs the mentioned assemblies in the directory:
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0
I just installed visual studio 2010 and upgraded my MVC project (which was running on MVC RC2 in visual studio 2008).
visual studio 2010 updated every project file to target the framework 4.0.
But the system.web.dll is pointing to
C:\Program Files (x86)\Microsoft
ASP.NET\ASP.NET MVC
2\Assemblies\System.Web.Mvc.dll
in VS2010 object browser, I have every dll showing up in multiple versions as expected (3.5.0.0 and 4.0.0.0) except for the System.Web.Mvc dll which doesn't show any version and points to the path I mentioned above.
Isn't this namespace point to the Framework folder like the System.Web namespace?
C:\Program Files (x86)\Reference
Assemblies\Microsoft\Framework.NETFramework\v4.0\System.Web.dll
MVC 2 uses the same binary for .NET 3.5 and .NET 4.0.
I installed MVC 1.0. Where's the System.Web.MVC dll so that I can use reflector to see how the helper methods are coded? I've looked in the bin folder of my ASP.NET MVC web app but it's not there. I am not quite sure where the MVC 1.0 installer installs the dll and how that wires up to the web.config of your MVC apps. Is System.Web.MVC installed in the GAC or something? If so, how the heck can I reflect over the assembly?
Mine was in C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies\System.Web.Mvc.dll.
Mine is at: C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies
You can view the actual source code on-line at http://aspnetwebstack.codeplex.com/. Sometimes the version there lags the release, but it's usually pretty up-to-date. When I use Reflector, I just add the assembly from C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies.
If you're looking to reflect any DLL referenced by your project, just right click on the DLL under References in Project Explorer, click Properties, and it will tell you the exact path.
Looks like this has changed for VS2015/Windows10. Mine is under:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\Web\Razor\v3.0\MVC5.1
OR
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45
Scott says we need these 3 DLLs in our BIN folder:
1 - System.Web.Abstractions.dll,
2 - System.Web.Mvc.dll, and
3 - System.Web.Routing.dll
I installed the AspNetMVC1.msi on Windows 2008 x64 and found this file but the others seem to be missing in action. Any ideas?
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 1.0\Assemblies\System.Web.Mvc.dll and xml but the other 2 are hiding somewhere else?
The other files are part of SP1 of the .NET Framework.
They are in the directory C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\
They are also registerd with the gac when you install sp1.