Net standard Library missing reference in ASP.NET Boilerplate - asp.net-mvc

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.

Related

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

TFS Build The reference assemblies for framework ".NETFramework,Version=v4.6" were not found

A TFS 2012 build server with .NET 4.6 installed produces the error message below when trying to build a website targetting .NET 4.6.
The machine has been restarted since the install.
Do I need to somehow tell TFS to favor .NET 4.6?
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets
(983): The reference assemblies for framework
".NETFramework,Version=v4.6" were not found. To resolve this, install
the SDK or Targeting Pack for this framework version or retarget your
application to a version of the framework for which you have the SDK
or Targeting Pack installed. Note that assemblies will be resolved
from the Global Assembly Cache (GAC) and will be used in place of
reference assemblies. Therefore your assembly may not be correctly
targeted for the framework you intend.
I installed the .NET Framework 4.6 Targeting Pack on the build server and that resolved it for me.
Firstly, you need to be sure that all referenced assemblies in the project can be found on the TFS build server. For best practice, you need to install VS2015 on the build server machine.
Secondly, you need to customize your TFS build process template to explicitly set the ToolPath variable in the Run MSBuild for Project activity to be C:\Program Files (x86)\MSBuild\14.0\Bin. Or add /tv:14.0 argument to MSBuild command.

ASP.NET MVC4 solution fails to build after installing KB2993928

We have an ASP.NET MVC 4 solution with a couple of references that has been building without problems for about 2 years now. However, after installing KB2993928 and KB2993937 this morning, we cannot run FxCop on this solution on our Windows 7 machines anymore.
I have a feeling this is because this update changed the DLL version of the System.Web.Mvc assembly in the GAC. This is because in the GAC I can currently find 3 different System.Web.Mvc DLLs, which are all updated today.
The error we receive in the build is as follows:
6>MSBUILD : error : CA0001 : The following error was encountered while reading module 'FrontEnd.Implementation': Assembly reference cannot be resolved: System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. [C:\Project\FrontEnd\02-Implementation\02-Implementation.csproj]
6>MSBUILD : error : CA0058 : The referenced assembly 'System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be found. This assembly is required for analysis and was referenced by: S:\Deliverables\FrontEnd\bin\FrontEnd.Implementation.dll. [C:\Project\FrontEnd\02-Implementation\02-Implementation.csproj]
Since we use ASP.NET MVC 4, this version 3.0 DLL is referenced indirectly by one of our references. For instance, RazorGenerator references version 3.0.0.0. Possibly others as well. There is no new version of RazorGenerator from what I can tell.
The System.Web.Mvc versions I see in the GAC are: 3.0.50813.1, 4.0.40804.0 and 5.0.20821.0.
I removed the reference to System.Web.Mvc from our projects and added Mvc as a NuGet package instead. This fixes our compilation, but FxCop still doesn't work due to the indirect references.
If any additional information is required please let me know.
If this issue is caused by references which in turn have dependencies on those specific assemblies, you can remedy this by coercing FxCop to use only the StrongName and ignore the version number. This solution is described here.
Of course the real solution would be to update the referenced assemblies (with the indirect dependencies) to newer versions.
Solution:
Uninstall the MVC Framework via "Programs and Features" (whichever version you're using)
Re-install MVC Framework (http://www.asp.net/mvc/mvc4)
Should fix the problem - no changes to the build/solutions is required.
This was done by a security update on October 15th from Windows Update. You will need to run the updates on your build servers too.
Link to update:
http://www.microsoft.com/en-ie/download/details.aspx?id=44533
This update fixes other versions as well.
You will likely have to update your projects to the newer version, as it changes the version number and removes the older version completely.
Remove any references to System.Web.MVC and then re-add them by manually browsing to the dll (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.Mvc\v4.0_5.1.0.0__31bf3856ad364e35\System.Web.MVC.dll on our machine). A lot faster than re-installing MVC if this has just taken your production server down!
The security updates update the assembly version of system.web.mvc.dll. You need to update your csproject to correct the version. Check this post:
ASP.NET MVC security patch to version 3.0.0.1 breaks build
I used the following solution and it's work perfectly:
https://stackoverflow.com/a/26490590
(don't forget to select the default project on the Package Manager Console for each project with the build failed)

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.

assembly uses System.Web.Http 5.1 which has a higher version than referenced assembly System.Web.Http 5.0

I created a new Project in Visual Studio 2013, a WebApi & MVC 5 project and updated all nuget packages. It updated to mvc 5.1. Now I cannot Successfully build the project it says
assembly uses System.Web.Http 5.1.0.0 which has a higher version than referenced assembly System.Web.Http 5.0.0.0
Anyone run into this before? Why these kind of problems do occur so often in Visual Studio? Does anybody know how to solve this because I really am trying hard but no luck so far...
Solved
I opened the Package Manager Console in Visual Studio and run the command
PM> Update-package
It magically resolved everything for me. You can find Package Manager Console under
Tools
Nuget Package Manager
Package Manager Console
This command deletes all the old packages under the package folder and updates everything if necessary, you may also run the command on a specific package. Here all the variants of the command http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference#Update-Package
Let me know if you found this useful I'm curious to know if it just happened to me accidentally
A new version of ASP.NET was released. Announcement here : http://blogs.msdn.com/b/webdev/archive/2014/01/20/announcing-the-release-of-asp-net-mvc-5-1-asp-net-web-api-2-1-and-asp-net-web-pages-3-1.aspx
You probably have two projects in your solution, where project A references project B. Both projects reference ASP.NET, but there is a version mismatch.
I had a very similar problem to yours exactly with a reference to System.Web.Http and have documented it here:
Could not load assembly error
When you update a Nuget package it would update dependent packages. But it would not update other packages in your solution that depend on the updated packages. These other packages might not even have a newer version built with the udpated packages.
So the solution is either to udpate all your packages like you did (this might not always work) or add binding redirects to the latest version of your assembly reference to your application config.
I solved this way. As I currently have fwk 4.0.0.0 and don't want to install 5.X:
I removed the referenced DLLs
I removed a couple of bindingRedirects at packages.config,
Then I rebuilded that solution, that throws me errors
Then I added the reference again
And voilĂ , the solution is running with the fwk that I have.

Resources