Whats going on with MVC5+ Assemblies? - asp.net-mvc

I was planning to upgrade my project from MVC 4 to MVC5. I followed this article: http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2. I did all the steps successfully, but got errors that the 5.0 dll could not be loaded.
The article, however, has no mention of where to get the DLLs. So I started looking for the DLLs everywhere, my file system, online, Google, etc.
Then I created my own MVC5 test project and noticed that the MVC 5.1 DLLs got added from nuget.
So, is Microsoft only distributing MVC dlls from nuget?
Also, I can find the MVC4 dlls from the file system and MVC5.1 dlls from the nuget package, where are the MVC5.0 dlls?

If you want a specific version from NuGet, open the Package Manager Console and type:
Install-Package Microsoft.AspNet.Mvc -Version 5.0.1
Which is the latest in the 5.0 series.

Related

Net standard Library missing reference in ASP.NET Boilerplate

every time i clone Abp.ModuleZero to my machine when i run nuget command update-database the error show me and when i build the solution in viusal studio the project doesn't build and show many errors in error list console window
most of them is like :
The type 'Object' is defined in an assembly that is not referenced.
You must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
i try to install Netstandard.library package from package manager console window but doesn't any sense.
my visual studio IDE version is 2015 Update 3.
ABP v3.0.0 is based on .NET Standard 2.0.
This concerns you regardless if you are on MVC 5.x, .NET Framework 4.x or .NET Core 2.x.
You should use VS2017 15.3.3+.
For VS2015, you may try installing NuGet client 3.6 or higher but that may no longer work.
i think downgrade to earlier version of this framework is good solution for me, where can i download early version of ABP framework like 2.3.4?
I don't see why you would download the framework, but it's on GitHub.
If you meant download a template that uses an earlier version of ABP:
You can only choose the project version for premium startup templates.
You can build your own from module-zero-core-template/releases/tag/v2.5.1.
You need to rename the files and folders yourself.

After installing microsoft.aspnet.core through nuget, all my packages got NU1002 error, what's wrong?

At first, I built up a ASP.NET5/MVC6 project with .netcore in VS2015 community, everything was OK. With going deeper and deeper. I have to use session or tempdata, but after I add microsoft.netcore.session package, package restore will fail and all my existing package got NU1002 error said: NU1002 the dependency XXXX in project XXXX does not support framework DNX, version=v4.5.1. Like the picture.
Error on all packages
But if I uninstall the session package, eveything is OK. What's wrong with this ? My sdk version in global.json is 1.0.0-rc1-update1 and I have removed DNX5.0 from project.json. Does anyone could help me?
According to your screenshot you are using DNX framework in your project, which should be the old version ASP.NET 5 project framework. After ASP.NET 5 upgrade to .NET Core, the framework is now called .NETCoreApp. And the SDK version now is 1.0.0-preview2-003121. The error message also means the dependency does not support framework DNX. I have installed the Microsoft.AspNetCore.Session package successful in my Visual Studio 2015 with latest .NET Core SDK version.
So I suggest you download the latest .NET Core SDK installer from below link and then create a new .NET Core application and then move your original project files to the new project and then install the session package.
https://www.microsoft.com/net/download
If your project is create by ASP.NET 5 RC1 project template, please refer to following article to migrate it to ASP.NET Core 1.0.
https://docs.asp.net/en/latest/migration/rc1-to-rtm.html

What can I uninstall after upgrade to ASP.NET MVC 5

I have upgraded the server to ASP.MVC 5.
In Control Panel in Installed Programes, I found:
ASP.NET MVC 2
ASP.NET MVC 3
ASP.NET MVC 4
ASP.NET MVC 4 Runtime
It is safe to uninstall all of this older ASP.NET MVC? There is no ASP.NET MVC 5 in list. It is because it was installed via Nuget?
MVC is bin deployable - meaning that you don't have to install it at all if you don't want to. Earlier versions of MVC were easier to run if you had installed them, so this is probably why you have installations.
By default, anything you fetch from nuget is bin deployed (as it isn't installed on your machine, the files are added to your project).
You can safely remove any installed MVC packages - and if you do have projects that depend upon them, you can install MVC in any project using nuget, and specifying a version (back to version 3) - for example:
Install-Package Microsoft.AspNet.Mvc -Version 3.0.50813.1
Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804
Install-Package Microsoft.AspNet.Mvc -Version 5.2.0
There are no dependencies of newer MVC versions on older ones, they are simply a newer version of the set of dlls, so there should be no issue removing older versions.
There are no dependencies of newer MVC versions on older ones, they are simply a newer version of the set of dlls, so there should be no issue removing older versions.
Are you sure???
NuGet decided to upgrade an MVC 4 to 5 box and it hosed the solution. Right now, I have this problem:
access method 'System.Web.Http.HttpConfiguration.DefaultFormatters()' failed
But, any solution found on the web right now has not worked.
It seems Microsoft is back to the ol' marketing tricks, bundling crap galore and creating an evangelizing environment where those using their technologies spend an inordinate amount of time on THEIR technologies, not the end solutions. I'm so frickin' mad that if my solution doesn't start working soon I'm tossing Asp.Net MVC after using it for four version with ZERO problems like this and going node.js.

Moving ASP.NET MVC project folder in VS 2013 changes System.Web.Mvc version to 4.0.0

When starting a new Web Application empty MVC project in VS 2013 using .NET 4.5.2, initially, VS 2013 will be referencing Microsoft.AspNet.Mvc 5.1.2 which contains System.Web.Mvc 5.1.0. But I typically change the directory of the MVC project so I remove the project from the solution, change the directory of the project using Windows Explorer, and then add the existing project again in the solution using VS 2013.
However, upon doing this, when I look on the version of System.Web.Mvc, it is now changed to 4.0.0. I've checked the repositories.config and it has the correct path for packages.config of the project. The packages config on the project also contains version="5.1.2" although the referenced System.Web.Mvc is 4.0.0.
Furthermore, as I am trying to use IAuthenticationFilter, the interface cannot be detected by Intellisense anymore (with red squiggly line) but I can still compile and run!
Do you guys know any workaround for this? I can use NuGet to update MVC to the latest (5.2.2 I think) and the reference would be fixed but I want to use the default 5.1.2.
you can target a specific version of MVC using the Nuget Package Manager Console:
Go to
Tools > NuGet Package Manager > Package Manage Console
At the prompt you can type
update-package Microsoft.AspNet.Mvc -version 5.1.2
I believe this is the easiest way to accomplish what you are trying to achieve. You may need to remove existing references to the MVC and WebPages dlls, sometimes references stick when moving from local/GAC references to those determined by nuget.

Nuget Package: Use Different MVC Version When Available

I've got an open source nuget package AttributeRouting. Currently the packaged assemblies reference System.Web.Mvc version 2. I'd like to reference MVC 3/4 in MVC 3/4 projects, so that users of Windows 8/VS 2011 don't have to install MVC 2 to use the package. Anyone know of a way to do this? Google has not been my friend.
Current, Nuget can't do this. This is why there are separate MVC2 and MVC3 packages of libraries in the Nuget gallery.
So you have to create a separate Nuget package for MVC3 and MVC4 (if necessary)
You can add into your Nuget package the assemblies for all supported versions of MVC and then use install.ps1 script to remove unnecessary ones and leave only the assembly which is compatible with MVC version used in the target project.
You will find more detailed instructions and an example of install.ps1 script here:
http://blogs.korzh.com/2013/12/nuget-package-different-mvc-versions.html

Resources