C # project in Visual Studio cannot find the System Library after upgrading to Visual Studio 2015 or .NET 4.6.1

I have a solution that builds seamlessly on Windows 8.1 using Visual Studio Professional 2013 (version 12.0.40629.00 Update 5). Each project in this environment has a target structure of ".NET Framework 4.6.1". I will call the "old" environment

When I pull out the solution in the Windows 10 window using Visual Studio Community 2015 (version 14.0.24720.00 Update 1), some of the projects within the solution cannot find the "System" assembly. This is a "new" environment.

The properties for System.dll in the Old environment in a project that is not created in the New environment show the expected path "C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework. NetFramework \ v4.6.1 \ System. dll "

In the same project in the "New" environment, the assembly of the system has no path, it is allowed to "False" and has a yellow triangle in the directory.

I tried to delete and read the link in the "New" environment, but the yellow triangle is still displayed in the link to the system assembly.

Other projects in the "New" environment allow the assembly of the system in the same way as in the "old" environment.

I am building a System assembly, but the same thing happens in several projects for any reference to the system that I reference, for example System.Core, System.Data, System.Web, System.Xml, etc.

What am I missing? What other information do I need to provide to help me solve system build problems?

UPDATE: Understood why the project was not built

In the project file, I deleted the following and was able to successfully recover:

<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" /> </Target> 

Why does this Nuget configuration information in the project file stop my project from creating, but only in the "New" environment?

+5
source share

Source: https://habr.com/ru/post/1247519/


All Articles