问题
I got this error
Your project does not reference ".NETFramework,Version=v4.6.1" framework. Add a reference to ".NETFramework,Version=v4.6.1" in the "TargetFrameworks" property of your project file and then re-run NuGet restore.
after checkout a project from company repository and rebuild on my machine.
When I try to install .Net461 (downloaded from here) they said
.NET Framework 4.6.1 or a later update is already installed on this computer.
This is all .NET framework versions on my machine (Windows 10 1703)
PS C:\Users\longnx\Downloads> & '.\check-dotnet-framework-version (1).ps1'
PSChildName Version Release
----------- ------- -------
v2.0.50727 2.0.50727.4927
v3.0 3.0.30729.4926
Windows Communication Foundation 3.0.4506.4926
Windows Presentation Foundation 3.0.6920.4902
v3.5 3.5.30729.4926
Client 4.7.03062 461814
Full 4.7.03062 461814
Client 4.0.0.0
PS C:\Users\longnx\Downloads>
How can I fix this error?
回答1:
I found this link from a google search and tried it and it fixed my issue so I thought I might share that deleting the obj folders seems to work.
As it states in forum
I found this link from a google search and tried it and it fixed my issue so I thought I might share that deleting the obj folders seems to work.
two users found that this fix the issue.
most also found doing a clean and then removing the obj folder by hand then redoing a nuget restore seemed to fix the issue.
来源:https://stackoverflow.com/questions/56529278/how-to-fix-your-project-does-not-reference-netframework-version-v4-6-1-frame