Microsoft.NETCore.APP >= 1.01 could not be resolved on Windows 7 - visual-studio

I have installed Microsoft Visual Studio 2015 Enterprise edition update 3 on my Windows 7 machine.I also installed .Net Core packages from this link:
https://www.microsoft.com/net/core#windows
I rebooted the machine after the installation. Now when I try and create a simple web application it throws errors related to project.json. The following are the errors thrown in Visual Studio 2015:
Severity Code Description Project File Line Suppression State
Error NU1001 The dependency Microsoft.NETCore.App >= 1.0.1 could not be resolved. WebApplication14 C:\WebApplication14\src\WebApplication14\project.json 3
I haves similar errors to all the dependencies in the project.json file. I tried many options mentioned online but it did not resolve the issue. I also tried uninstalling and installing .Net core and no luck. Could you let me know how I could fix this issue.

I was able to resolve the issue. I tried uninstalling and installing .Net core and it did not work. The problem was with the NuGet Cache. The cache is stored in different location and we need to clear it which will help the packages to be restored. Follow these steps:
Go to the directory where nuget.exe has been installed and run these commands:
1) nuget locals all -list
2) nuget locals all -clear
When you run the second command you will get a warning we can just ignore that.After executing these two commands restart Visual Studio and open the project solution and it should work.

Related

Flutter windows build: Nuget is not installed

I uninstalled Visual Studio 2019 and installed it as 2022.
I reinstalled Flutter.
When building Flutter desktop, the following problem is repeated.
If I run it in another project, it works without any problem.
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
Nuget is not installed.
Nuget.exe not found, trying to download or use cached version.
1- make sure you have installed Visual Studio
2-
NuGet Package Manager (PM UI and PM Console) is included with Visual
Studio. The latest NuGet releases are delivered as part of Visual
Studio updates.
HOWEVER: nuget.exe itself is not included with any version of Visual Studio.
so you need to download the latest NuGet Windows x86 Commandline from https://www.nuget.org/downloads
3- put it inside the flutter sdk folder or any folder you like
4- copy the folder path
5- in windows serach, search for env so you can put it as system variables. edit path with a new line and past the folder path
6- restart android studio
7- congrats
there's a video on youtube for the exact steps:
https://www.youtube.com/watch?v=J5b5sj6mG8M
Although I don't know why it would work without this error message on the same machine, I recently ran into this issue as well. The way I fixed it was to download the nuget executable and add it to my path.

how generate project.assets.json

I create a new .NET Standard project and try to build without any code added, I get
"Assets file 'E:\Storage\Google Drive\My Content\My Documents\My LC
TECH\Projects\LC Development\LC.Assets\obj\project.assets.json' not
found. Run a NuGet package restore to generate this file."
I've tried to run dotnet restore but without luck.
How to create the file or remove reference to it?
I use Visual Studio 2019 preview, but had same error when using Visual Studio 2017.
turned out that this was caused by an faulty installation of .net core sdk.
installed everything again and it started working

VS2017 Metadata file '.dll' could not be found

After upgrading to Visual Studio 2017, I am unable to build my project. Visual Studio 2015 still works when pointing at the exact same project.
this is the build errors I get Metadata file '******.dll' could not be found
I've already tried https://stackoverflow.com/a/17723774/3511012 with no success
I tracked the issue down to a specific NuGet package that has not yet been updated for visual studio 2017. (Baseclass.Contrib)
It isn't yet registered as having updates available through the nuget package manager, but you can manually update using the nuget console and running this command Install-Package Baseclass.Contrib.Nuget.Output -Version 2.3.0-vs20172

Is it possible to restore Nuget packages with a Xamarin.iOS build using TFS online?

I am trying to automate my build process for my Xamarin.iOS application. I have managed to get a Xamarin.Android and UWP build working find on my on site Windows build agent.
I am now trying to build a Xamarin.iOS application using my On Site Mac build agent.
I have added the Restore Nuget packages as the first step in this build definition but keep getting the error:
MSBuild auto-detection: using msbuild version '4.0' from
'/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5'.
MsBuild.exe does not exist at
'/Library/Frameworks/Mono.framework/Versions/4.2.3/lib/mono/4.5/msbuild.exe'.
Error: /usr/local/bin/nuget failed with return code: 1 Return code: 1
But I'm not sure what it's trying to do here at the nuget installer stage.
So is this possible to do?
There is a known issue with nuget restore command on non-Windows operating systems:
Restore - Restore works with packages.config and project.json files
but will not yet work with *.sln solution files
So you can try to update the "Restore Nuget Packages" step to restore the packages.config file instead of solution file. If it still does not work, then try to change the "Installation type" from "Restore" to "Install".
NuGet 3.2
With NuGet 3.2, the following commands have been tested to work:
Config
Delete
Help
Install
List
Push
SetApiKey
Sources
Spec
Refer to this link for details: NuGet Compatibility.
I was having a similar issue. My log said:
Unable to find version '2.1.0' of package 'Acr.Support'.
[error]Error: /usr/local/bin/nuget failed with return code: 1
After some digging in the logs I tried to restore the nuget packages on my local mac. I opened the terminal and typed :
sudo cd /usr/local/bin
[enter password]
Your nuget executable should be located there.
I executed:
nuget
To see my nuget version, which was 2.12.0.0
I noticed that this is an old version so I updated it by:
sudo su
[enter password]
nuget update -self
I noticed that it updated to 3.4.4 rtm final, I started my Visual Studio Online flow again and it worked! Hopefully this helps anyone.

Nuget versioning issue with package restore

I am unable to install a package (using package restore) due to some kind of versioning issue with Nuget. Here are the steps I took:
build project:
error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
Extension manager says version is: 2.0.30619.9119.
Ok, restart VS as administrator, extension manager uninstall nuget.
restart VS as administrator again, search for nuget and install.
Extension manager again says version is: 2.0.30619.9119.
rebuild project:
error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
Ok, so restart VS as administrator, extension manager uninstall nuget again.
This time download from http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c
Run the installer, all seems ok.
Extension manager again says version is: 2.0.30619.9119.
rebuild project:
error : The schema version of 'MagicalUnicorn.MvcErrorToolkit' is incompatible with version 1.6.21205.9031 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
Grr! Any ideas?
It looks like problem in nuget command line tool. When you enable 'Nuget package restore' feature it adds .nuget folder to you solution with nuget.exe. And when you compile project this tool is using to download missing packages, not VS extension is used here. So try update this tool from command line:
cd .nuget
nuget.exe update -Self
Procedure screenshot:
The following worked for me in Visual Studio 2012:
Run VS 2012 as Administrator
Click Tools -- Extensions and Updates
In the left nav, Updates -- Visual Studio Gallery
Click Update on NuGet Package Manager
Install the update
Restart Visual Studio
None of the offered solutions worked for me (Visual Studio 2013, Nuget Package Manager Version 2.8.5).
I had same error but it was saying I had version 2.5.4.
I fixed it by going to Tools > Nuget Manager Console > Nuget Package Console. This open's up a command line window. At the top of the window was a prompt to download missing packages for my project.
Pressed the download button and errors went away upon build.
I was facing the same issue. I resolved it by selecting Tools on VS 2010 Menu --> Library Package Manager --> Package Manager Settings --> Check "Automatically check for updates". After that I restarted VS and was prompted for Nuget Update Installation. Once the update was installed, the Nuget package, HTTP Client in my case, got installed smoothly.
I faced to this problem and I checked all answers that were this page and at the end my problem did not solved. After lot of search on web I could update my nuget from original site
http://docs.nuget.org/docs/start-here/installing-nuget
and for example for vs2010 :
http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c
At this site select your version of VS and then update it .
Note : before installing nuget,close all Visual Studios and after install,Open your project.
Thanks
This above did not work for me, completely. There is one last step that is IMPORTANT to note. After downloading the latest nuget version, you may notice that the same error prints in the output window. The reason is due to the .nuget folder containing a NuGet.exe which specifies a version number.
The solution (for me and perhaps to those of your that did not resolve your issue with the above directions), is to
Delete the .nuget folder from you solution.
Right click your web project and click Enable Nuget Restore.
The directions above should cause a NEW .nuget folder to be added, this time the NuGet.exe should be the newest version of nuget that you downloaded.

Resources