Package Installation Error Microsoft.NetCore.UniversalWindowsPlatform.5.0.0 - windows

I just did a fresh install of visual studio community edition.
When I start a new project and choose 'Blank App (Universal Windows)' I get this error during project creation:
Package Installation Error
Could not add all required packages to the project. The following packages failed to install from 'C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK':
Microsoft.NetCore.UniversalWindowsPlatform.5.0.0: Package restore failed. Rolling back package changes for 'AppTest'
Any ideas what the cause of this error can be?
I installed all the Universal Windows App Development Tools:
- Tools (1.3.2) and Windows 10 SDK (10.0.10586)
- Emulators for Windows 10 Mobile (10.0.10586)
- Windows 10 SDK (10.0.10240).
What am i missing. How can I solve this issue?

Sometimes nuget fails to install the UniversalWindowsPlatform package. Search for "Microsoft.NETCore.UniversalWindowsPlatform" nuget package and install it.

This is not an answer, I have the exact same issue and I have found other people with the same issue on the web, no one has come up with a solution yet.
This is upon creation of 'any' UWP project type, blank, templated, VB, C#.
This dialog pops up:
I have already found and tried all of the steps mentioned by Jay Zuo. This is actually for a slightly different issue, the dialog is exactly the same apart from the bit, where we have ': Package restore failed.'
They are getting ': Solution is not opened or not saved'
None of the steps on that post help resolve this issue.
I have tried restoring VS, Reinstalling the Windows 10 SDK, resetting VS using the various options to reset user data, environment etc, made sure the path to the SDK files exists.
Nothing has worked and my VS2015 Community is utterly useless right now for working on UWP projects. This is a new Windows 10 / VS install (VS on insider fast PC has no issue at all but I need this one on production build).
I am posting as an answer as I do not have enough points to comment but starting a new thread seems daft as this is the exact same issue, I just want to add more detail to it.

I had the same probem after a clean install of OS/Updates/VS 2015 Update 3 + Xamarin update. I created a Universal 'Blank XAML App (Xamarin Forms Portable)' During creation I received same error.
In the Nuget Package Manager Console pick AppX.UWP, then run:
Install-Package Microsoft.NETCore.UniversalWindowsPlatform
Restart VS and create a new project, error does not come back.

So after much back and forth between myself and an MS rep on their forums I did actually manage to resolve this.
The forum link is here
I did actually need to reset my VS installation to try and get a clean install.
Then the actual error reared its head. In my case it was Nuget caching corrupt packages (these are not cleaned by a VS reinstall).
The link that helped me resolve it in the end can be found here on Stack Overflow

What helped me was to update the UniversalWindowsPlatform package in nuget to 5.1.0. Then all went smoothly the next time I created UWP project.

Upgrading the package Microsoft.NetCore.UniversalWindowsPlatform.5.2.2 worked for me...

After facing a similar problem with Microsoft.NetCore.UniversalWindowsPlatform.5.2.3. I found a solution which might help someone. I navigated to my ProgramData\Microsoft\VisualStudio\Packages\Microsoft.Net.CoreUWP,version=1.0.4 and ran the netfx_NETCoreUWP.exe. It did resolve my problem

Just as a reference...
My NugetPackage "'Microsoft.NETCore.UniversalWindowsPlatform" disappeared from my project references. It showed up as installed in NuGet. I uninstalled and re-installed without success. I restarted Visual Studio and re-installed and the package reappeared :-) !

Related

Switching From VS Mac To VS Windows got "java.exe" exited with code 2

Hello Guys
I got an issue when switching my Xamarin.Forms project from VSMac to VsWindows!
"java.exe" exited with code 2 when deploying.
I already try:
delete bin/ obj/ folders
remove all packages and re-add them
MultiDex
Verify the path (removing special char "!##$%ˆ&*(-_" etc..)
If you got an idea, tell me ;)
Regards,
If G Clovs solution doesn't work, then:
make sure the netstandard on your mac is exactly the same on your Windows pc.
Make sure you have the same Android SDK downloaded on your Windows - through Tools Menu > SDK manager.
If you are using stable channel for vs for mac updates, then make sure you are not suing the preview of budget packages on your Windows.
Apply the same logic in 3 for preview channel.
To avoid all these issues:
Simply go to vs for mac 2019, change to stable build and update the vs for mac to latest.
Update all android SDK and build tools to say v28
Update all nugget packages for the two projects and build successfully.
Go to vs 2019 and update vs to latest.
Repeat step 2 for vs.
Deselect preview in nugget package manager, and update nugget packages in the two projects.
Build successful.
Try the below steps, it was working for me.
Open Visual Studio in Windows
Open your Solution
Find for "Resource.designer.cs" file in Android Project and delete it
Remove obj and debug folders form PCL and Android project
Clean and Rebuild
Happy Coding :)
Kishore Kumar
With turning third page of google, I didn't find any answer.
But I found the answer by my own.
The issue was comming from the Android.csproj and the Keystore Path.
It was set to my Mac Path even if I had already changed it on
VSWindows AndroidProject => Properties => Signin
So I removed this lines on Android.csproj (edited with third text editor):
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>YourMacPath/Alias.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>Password</AndroidSigningStorePass>
<AndroidSigningKeyAlias>Alias</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>AliasPassword</AndroidSigningKeyPass>
On debug & release Part.
Then you can edit them on VS Windows.
Hope I helped someone.
See ya

Error while adding NuGet Package

I am getting the following exception while adding NuGet package to project. I am using the latest version of Visual Studio 2017 Pro.
try going to VS settings -> NuGet settings -> clear the NuGet cache, close Visual Studio, and delete all obj and bin folders in solutions .
Error while adding NuGet Package
AFAIK, It seems an issue which needs to be fixed from Xamarin team and someone already reported it:
https://bugzilla.xamarin.com/show_bug.cgi?id=61113
You can track this thread to get future updates for this issue.
Here are some of the workarounds already mentioned in that thread:
Update the packages with the option -IgnoreDependencies in the Package Manager Console (It works for me):
Update-Package -IgnoreDependencies
Update Visual Studio to latest version and running as Administrator
Some of the files in the packages folder were set to read-only. Try to cleare the read-only flag from all files in the packages folder.
Hope this helps.
I tried a lot of ways to solve this problem. But unfortunately cleaning the cache, project, rebuilding didn't help. The only thing I didn't try is to re-install Visual Studio or Windows.
I've got to launch project in Visual Studio for Mac and update/add all the necessary Nuget packages from there. On the Mac, the process was successful. I know this might not be an option if you don't have device, but it definitely works.

MSTest cannot find TestAdapter.dll

I'm using the built-in Visual Studio test tools (Test -> Run -> etc in the menu). I just started having a problem where I get the following error when I try to run tests
[3/29/2018 1:39:14 PM Error] System.IO.FileNotFoundException: C:\Users\brubin\AppData\Local\Temp\VisualStudioTestExplorerExtensions\MSTest.TestAdapter.1.1.18/build/_common/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
at Microsoft.VisualStudio.TestWindow.Controller.TestPlatformProvider.PerformShadowCopy(IEnumerable'1 testExtensions)
That's followed by some errors that say
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
When I look at the folder C:\Users\brubin\AppData\Local\Temp\VisualStudioTestExplorerExtensions\MSTest.TestAdapter.1.1.18/build/_common/, there are no files in that folder. However, I haven't knowingly changed anything about my test setup and this was working several days ago, so I don't know why it would have stopped working.
My projects are using the MSTest.TestFramework (MSTest V2) version v1.2 NuGet package.
One thing I noticed that may have caused this problem is that if I go to Tools -> Extensions and Updates, I see that my Microsoft Visual Studio Test Platform was updated a few days ago, on 3/23 (I think that's when I installed a Visual Studio update). However, if that broke something, I have no idea where to look to see what's broken, or how to fix it.
For me, clearing the VisualStudioTestExplorerExtensions folder and restarting Visual Studio (as per this github issue) did the trick. In my case, it contained two folders for different versions of MSTest.TestAdapter, I don't know whether or not that's relevant.
For anyone else who stumbles on this question, the problem was caused because a few of my test projects didn't have the MSTest.TestAdapter NuGet package included. I added the MSTest.TestAdapter package to all of my test projects, and the problem seems to be solved permanently now.
I spent the whole last week trying to solve the same issue. Only yesterday did I realize that running tests from the console is a time saver. Much to my surprise, I've just moved all my project -which was inside a "OneDrive" folder, to a different location. Now, it works like a charm! All my tests run from the Visual Studio IDE. I don't know if moving the files had anything to do with it, but you can give it a try.
Reinstalling all solution's Nuget packages fixed this issue for me.
Please run this command on the package console:
Update-Package -reinstall
then try again, or restart VS, then try again.
Reference: https://ardalis.com/force-nuget-to-reinstall-packages-without-updating/
Its a bug in Visual Studio. Upgrade the Visual Studio to version 15.7.
https://developercommunity.visualstudio.com/content/problem/222892/filenotfoundexception-microsoftvisualstudiotestpla.html
Yes you need to update "MsTest.TestAdapter" on all testprojects. The easiest way is to rightclick on master solution and click on manage nuget-packages. Then select " installed " tab and see if there is installed TestAdapter on each testprojects. If necessary you can update TestAdapter to newest version. Then restart Visual Studio and it should work.

Nuget package install error -- Invalid URI: The Authority/Host could not be parsed

I'm using NuGet within Visual Studio 2017 to try to install a package on an older Web Forms project, and it is failing with the following error:
Invalid URI: The Authority/Host could not be parsed
This only happens when trying to install the package on a website that is mapped in IIS (other types of projects work fine), so the project name is http://localhost..., etc., which is what I think it's having trouble parsing. It worked fine until just a few days ago and I'm not sure what caused it to change. Here is the full message I am receiving:
Resolved actions to install package 'Newtonsoft.Json.10.0.3'
Found package 'Newtonsoft.Json 10.0.3' in 'd:\packages'.
Package 'Newtonsoft.Json.10.0.3' already exists in folder 'd:\packages'
Install failed. Rolling back...
Package 'Newtonsoft.Json.10.0.3' does not exist in project 'http://localhost:89/'
Executing nuget actions took 71.95 ms
Failed to add reference to 'Newtonsoft.Json'.
Invalid URI: The Authority/Host could not be parsed.
Another related clue is that when I open "Manage NuGet Pacakges..." on the website project, it is not showing anything as being installed, even though the packages.config file clearly exists in this project with several references defined.
My environment is as follows:
Visual Studio Professional 2107 Version 15.5.2,
Microsoft.NET Framework Version 4.7.02556,
NuGet Package Manager Version 4.5.0, and my NuGet repository is set to install in D:\packages
Does anyone have any advice on what setting I might be able to change to get this working again?
NuGet does not appear to be working for local IIS Web Site projects in VS 15.5.1 to 15.5.5 (inclusive).
The workaround is:
Close VS
(Just in case) make a backup copy of the .sln (solution file)
In a text editor open the .sln file and find the line:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://www.devsite.com", "http://www.devsite.com", "{A8837508-9BC1-482A-86EF-4B3156CAFDBE}"
Amend the second parameter and save:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://www.devsite.com", "DevWebsiteFolderName", "{A8837508-9BC1-482A-86EF-4B3156CAFDBE}"
Open your solution.
Use NuGet as you wish :-)
Optional:
Close VS
Reverse your .sln change.
Open VS
For credit and further reference:
NuGet fails for website projects hosted on local IIS
Nuget looking in wrong location for packages.config in web forms web site running on IIS
This was driving me nuts... I spent hours trying to install the Authorize.net nuget package in VS2017 and it kept throwing the same error.
I finally opened my project up in VS2015 and installed it without any issues.
Hope this helps.
Jason
Given that we haven't gotten any help from Microsoft on this, we've adopted the convention of doing something like what Barry Kaye suggested, but for the second parameter, just replacing it with a single period "."
This issue appears to be fixed in 15.6.0. Try upgrading to that version, if you can.
I encountered the same problem and I solve it this way:
Right-click on the project -> Properties -> Debug -> App URL
(The app URL was not the correct one)

Visual Studio Tools for Apache Cordova : Error when creating or opening Project

I am running Visual Studio 2015 under Windows 10.
I was able to successfully create and open Cordova projects, but suddenly one day I started receiving the following error message:
An equivalent project (a project with the same global properties and tools version) is already present in the project collection, with the path "{path-to-cordova-project}". To load an equivalent into this project collection, unload this project first.
When I go to modify the Visual Studio installation, I can see "HTML/JavaScript (Apache Cordova)" appearing twice in the list of features:
As you can see, there is a replaced version, and an Update 1.
I have tried every combination of uninstalling/installing each of Apache Cordova (Replaced) and (Update 1), and also Tools and Windows SDK 10.0.10240. I also tried deselecting/selecting to reinstall.
I managed to get it working once for creating new projects, but when I opened a project which failed to open before, it started failing again for creation and opening, and haven't been able to get it working again.
I tried completely uninstalling VS 3 times, once using the command G:\vs_professional.exe /uninstall /force
I also tried tried renaming C:\ProgramData\Package Cache folder before installing again.
But it seems to be leaving bytes somewhere, because after reinstalling I can still see the Recent projects, and project templates downloaded before uninstalling.
I am now going to consider formatting the partition and reinstall Windows, but this is very frustrating and disappointing.
I hope someone come up with a solution for this before I proceed to format.
Thanks.
PS: I think the latest thing I installed before this started to happen was ASP.NET 5 Beta 7. But I am not sure if this was the root cause of this problem.
Same problem with (Visual Studio Tools for Apache Cordova Update 1 + ASP.NET 5 beta 7). I resolved it by uninstalling beta 7 of ASP.NET 5 (uninstall explain here) and do a devenv.exe /resetuserdata
Fixed it uninstalling apache cordova tools and using the vs installer to install it again.
Also did removed AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache and devenev /resetuserdata
so that may be also needed, not sure.

Resources