Related
When publishing my web application, I get the following error:
Done executing task "CopyPipelineFiles" -- FAILED.
Done building target "CopyAllFilesToSingleFolderForPackage" in project
"ServiceManagement.csproj" -- FAILED.
Done building project "ServiceManagement.csproj" -- FAILED.
I use Visual Studio 2015. I also tried opening it in administrator mode.
One possible cause is, if you have included some files in the project that are not necessary to compile (like PowerPoint files or word files), & then removed the files from the hard drive, but forgot to delete them in the "Solution Explorer" inside Visual Studio - then "Rebuild Solution" will work b/c those files were not necessary to compile - but "Publish" will fail b/c it cannot find those files when Visual Studio tries to copy files to the publish destination.
I was able to fix it with the following actions:
Remove all unrelated scripts and libraries that you are not using on your project.
Remove all src folders on your scripts.
Since I copied the whole project script files with its corresponding directories, this was I think the main issue that cause the publishing to fail as some filenames are long.
I retain only the one javascript file and one minified file, the same way with CSS files.
If you weren't able to still solve the issue after doing the actions above, try the following (Either of this actions works for us.):
Try to rebuild the project on a different machine.
I am using Visual Studio 2015 Professional Edition so I tried the Visual Studio 2017 to build and publish it.
I kind of had this issue and was because of a corrupted file that couldn't sync in OneDrive. I had a folder that coudn't be opened or deleted with the message "tag present in the reparse point buffer is invalid". By making a "chkdsk /r /f" in a Command Prompt (w/ admin permissions) my build was fixed and I could publish it again in Azure.
I installed Visual Studio Community 2015 and I created a project, but when I run the project I get this exception:
Microsoft.vshup.server.httphostx64.exe has stopped working
I am using Windows 8.
I would appreciate it if you could help me.
This is a bit late, but for everyone else struggling with this, in my case this issue was solved after deleting Webcompanion from Lavasoft and removing all register entries containing Lavasoft
This issue came up using VS2015 Community with Win8.1
I searched the solution for hours in order to remove this error! The Windows updates changed nothing for me. The best way to get rid of this error is to go to C:\Program Files (x86)\Common Files\Microsoft Shared and delete or rename the folder VSHub. Hope this was helpful!
We have finally produced a patch for this specific problem with VSHub crashing while debugging. There may be other issues with VS2015 and this patch doesn't solve all of them, but it is aimed directly at this problem. Please give it a try.
The patch is available via http://support.microsoft.com/kb/3090034.
Note: This patch will not be necessary on systems that have installed any of the future quarterly updates to Visual Studio 2015 RTM. Quarterly updates are expected to start shipping in the future and will have this fix along with other changes. We much prefer that you use a quarterly update rather than single patches like the one I referenced. Until quarterly updates are available, however, you'll need to use this patch.
Have you try this?
Stop Visual Studio if started
rename Microsoft.VsHub.Server.HttpHostx64.exe to
Microsoft.VsHub.Server.HttpHostx64.exe.bak
Create a copy of Microsoft.VsHub.Server.HttpHost.exe and rename it
Microsoft.VsHub.Server.HttpHostx64.exe
Re-start Visual Studio
http://thomas-barthelemy.github.io/2015/05/01/visual-studio-vshub/
I was also facing similar issue.
I renamed folder named VsHub to VsHub1 (Renamed to anything)
Path: C:\Program Files (x86)\Common Files\Microsoft Shared
Now its working
i need to find whether it is affecting at any other place
I soled the problem my installing
https://www.microsoft.com/en-us/download/details.aspx?id=49138
twice (the second time choose "repair" option).
Make sure the VS is close and VSHub is not running in Task manager
Please try this if you want to Fix this, it's worked for me:
Microsoft.VsHub.Server.HttpHostx64.exe has stopped working
Use This Root to locate your Error : C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\1.0.0.0
Close your visual studio 2015 (if Open / started)
End this process from Task Manager see the image above
Go to this Path: C:\Program Files (x86)\Common Files\Microsoft Shared\ and Find "VsHub" and rename it. That is !! ** you are DONE !**.
This Help me to get Rid of the Problem as Fast and Possible.
Just Uninstall WebCompanion Lavasoft software
I had the same issue due to corrupted drivers but it happened while debugging, I fixed it by
unchecking "use hardware graphic acceleration " from Tools > options > environment
and followed the steps in this post:
https://thomas-barthelemy.github.io/2015/05/01/visual-studio-vshub/
Navigate to
"C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\1.0.0.0"
Stop Visual Studio if started
rename Microsoft.VsHub.Server.HttpHostx64.exe to Microsoft.VsHub.Server.HttpHostx64.exe.bak
Create a copy of Microsoft.VsHub.Server.HttpHost.exe and rename it Microsoft.VsHub.Server.HttpHostx64.exe
Re-start Visual Studio
One fast thing to try, it helped one other guy with the same issue, he posted on official microsoft help forum (when I myself googled it I got your topic and 2 from official MS help forum as top hits)
AND helped me with also the same issue.
Most likely its some unwanted stuff on your PC, just use AdwCleaner or smth like that, I used that, the other guy also did some deleting though not sure if with the same soft.
I got the solution-
The crashing file is located in the following folder:
C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\1.0.0.0
It seems that the x86 version of the file does not have the same issue, so a simple fix, until a better one is officially published by Microsoft:
Stop Visual Studio if started rename
Microsoft.VsHub.Server.HttpHostx64.exe to
Microsoft.VsHub.Server.HttpHostx64.exe.bak Create a copy of
Microsoft.VsHub.Server.HttpHost.exe and rename it
Microsoft.VsHub.Server.HttpHostx64.exe Re-start Visual Studio
I was facing the same problem and resolved it by removing the VsHub directory at below location.
C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\
this is the simplest way the fix the problem, VS will recreate the directory on it need.
I just downloaded Visual Studio Code and my Intellisense is not automatically working.
The two settings that control this seem to be set correctly:
"editor.quickSuggestions": true,
"editor.suggestOnTriggerCharacters": true,
I do get an Intellisense menu when i start typing and press "CTRL + Space", but this gives me a list of everything and not things specifically for my object.
What am i doing wrong?
If you have a workspace and for some reason have multiple folders you may need to 'help' omnisharp a bit. I initially had a big project and added a solution for it further on - ending up with TWO workspace folders (one to a startup project and one to the solution). After composing that setup I experienced only the first project to have intellisense working.
Solution to get intellisense working was to make sure omnisharp worked its way from the solution instead of the project:
Ctrl + Shift + p
Write "OmniSharp: Select Project" and press Enter.
Choose the solution workspace entry.
Inspiration gotten from 'swaner':
https://github.com/OmniSharp/omnisharp-vscode/issues/1889
Visual Studio Code's more advanced editing features (IntelliSense, refactoring tools, etc.) only work in C# files if you have a project.json file or *.sln file that VSCode is aware of. Open the folder (i.e. open the File menu and click Open Folder...) with the *.sln file or project.json and VSCode will attempt to find all project/solution files in the folder. If there are multiple projects, you may need to select one from the projects button on the right side of the status bar (bottom of the window).
From the VSCode website:
Selecting a project.json-file is opening a DNX-project and VSCode will load that project plus the referenced projects
Selecting a *.sln-file is opening a MSBuild-project. It will load the referenced *.csproj-projects and sibling or descendant project.json-files but no other project files that are referenced from the solution file.
Selecting a folder will make VSCode scan for *.sln and project.json files and VSCode will attempt to load them all.
If you are start your project with c#, then some time you haven't download extension.
Process by written
Ctrl + Shift + p.
Write "OmniSharp: Select Project" and press Enter.
Choose the solution workspace entry.
Then enable the c# extension for "OmniSharp : Project".
Process by image
Downgrading to 1.23.9 of the C# VS Code extension fixed the intellisense for me. So if nothing else is working for you, perhaps try installing an older version of the extension (doesn't necessarily have to be that exact one I mentioned). You can do this by selecting this option in VS Code:
As of the 0.5 version I have found that I need to close and re-open my working files to get some new intellisense information to start working for my own files. This usually happens after I have a file open that needs to use type information from another file I just created. Until I close and re-open them (within the editor) the intellisense doesn't always work.
Hopefully this is something that'll get fixed as the app matures.
Inorder to make the intelligence working, the Visual Studio Code extension OmniSharp should be there along with Mono. When you open a project/solution folder, the OmniSharp gets the project dependencies from either project.json or from the dotnet solution file (if the project/solution created with other versions of visual studio).
So, when you look at the omnisharp's output window after immediately opening the project/ solution folder, you may see the following lines
Starting OmniSharp server at 2017-9-18 09:26:44
Target: /Users/{username}/Source/{Your Solution Folder}/{Your Solution
file}.sln
OmniSharp server started wth Mono
Path: /Users/{username}/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/run
PID: 5808
post that, you may see couple of lines coming up like below,
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: {Your Project1 Name}
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: {Your Project2 Name}
....
they mean that your projects are getting recognised by OmniSharp Extension.
If you get any error message informing you about timeout, please get into the settings of the Visual Studio Code, and add a configuration override like the one below:
"omnisharp.projectLoadTimeout": 200
I know it is too long to wait for 200 seconds. But don't worry, this won't stop you anymore working with project files. But, remember that the IntelliSense will be automatically available once all the projects in the folder are successfully loaded.
Feel free to extend the Timeout setting since it will help you getting intellisense even-though you are not getting it immediately.
Here is another link with the same solution: https://github.com/OmniSharp/omnisharp-vscode/issues/1585
Hope my information helps you! Enjoy your VSCode!
This case was for an existing project that was working fine before. Opened via the vs code "recent" history.
For dotnet core. I opened my project's *.csprog file, made no changes, and saved it via the vs code editor.
As soon as I saved, all of the intellisense stuff starting working again in my other files within that project.
Another troubleshooting strategy to try if none of the above works out is uninstalling Mono, which is unnecessary anyways if you're using .NET Core. I also experienced a sudden disappearance of Intellisense after pulling changes to one of our enterprise repos that included an upgrade from ASP.NET Core 2.0 to 2.1. Strangely, at the same time, Intellisense was working fine in another C# project repo running ASP.NET Core 2.2.
For the project in question, I was puzzled to see successful logs for each reboot of the Omnisharp server as well as perfectly clean builds and runs. The puzzlement increased as I compared these Omnisharp logs to those from the 2.2 project and found them effectively identical.
Upon uninstalling Mono, the one detail that changed is how Omnisharp started. Now it boots up from a shell script located at ~/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/run. Previously, Mono itself was booting the server from the executable at ~/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/Omnisharp.exe.
Other troubleshooting I attempted in this instance though to no avail:
dotnet clean / Deleting bin and obj directories
Updating launch.json to point at the proper /bin/Debug/netcoreapp2.1 build
directory
Wiping my local nuget cache
Restarting Omnisharp
Uninstalling and reinstalling VS Code, as well as bumping back a version from 1.33.1 as the breakage coincided oddly with the March 2019 update
Uninstalling and reinstalling the C# VS Code extension, as well as bumping back a version from 1.19.0 given other users' reports of said version interfering with Intellisense for certain projects*
Adding a global.json file at project root to override default utilization of latest .NET Core SDK (mine was 2.2.105) and run instead using 2.1.302 in concert with the project's version
Wiping/rebuilding the project .sln file
Specs: VS Code 1.33.1, C# Extension 1.19.0, MacOS High Sierra 10.13.6.
*NB: As it turns out, in another .NET Core 2.1 project with the same issues in VS Code as described above, uninstalling Mono alone did not fix things. I also did wind up needing to bump back the C# extension to v. 1.18.0 to recover Intellisense. Weird.
The issue I had was OmniSharp was an older version. I set the flag to update to latest version in Settings.json file. This ensures the extension is always the latest version.
"omnisharp.path": "latest"
And restarted VS code. That fixed it for me.
Simply reinstall the extension and restart the VSCode/PC.
I use Task Manager and kill the Visual Studio Code process, then restart Visual Studio Code, the intellisense shows and fixed.
I've had some good experiences in C# with this extension so far:
https://marketplace.visualstudio.com/items?itemName=jchannon.csharpextensions
This extension traverses up the folder tree to find the project.json or *.csproj and uses that as the parent folder to determine namespaces.
Try "Install Extension" from command Pallete - probably if C# intellisense is not there:
https://code.visualstudio.com/docs/customization/colorizer
if intellisense in not working for react js or javascript or node js this solution will help for windows
uninistall type script by typing npm uninstall -g typescript
install specific version of type script that is 3.3 by typing npm install -g typescript#3.3
add the typescript location in vscode by navigating to file > Preferences > settings > here search for edit in setting.json then add this path "typescript.tsdk": "/Users/yourusename/AppData/Roaming/npm/node_modules/typescript/lib"
settings.json should look someting like this
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection":"automaticallyOverrodeDefaultValue",
"typescript.tsdk": "/Users/yourusername/AppData/Roaming/npm/node_modules/typescript/lib"
}
I was able to fix this by changing the Api Compatibility Level from .Net Standard 2.0 to .NT 4.x. You can find this setting on Project Settings / Player.
After that, intellisense started working again.
This is because of C# extension issue.
Reinstall the extension will work.
https://code.visualstudio.com/docs/editor/intellisense
https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp
I fixed this with a multiple project solution in .net5 / .net core 3.1 by
opening each project (not the sln folder) in VSCODE. This then prompts to add the resources/ .CSX? files to the project; enabling intellisense, per project. Finally close that window and reopen the solution folder and all works as expected.
See image
Add VSCode assets
Downgrading to 1.23.9 of C# for Visual Studio Code (powered by OmniSharp).
https://i.stack.imgur.com/VrdJl.png
After trying several things I looked at the OmniSharp logs only to realize that because I had two different sln files in my workspace. It had picked up the “other” one and thus wasn’t working. I deleted it, reopened vs code, and all is well again.
For me I had been working without internet for a long time. It had previously been working but then stopped. I closed+reopened VSCode with a stable wifi connection and the Output tab in VSCode popped up, displaying the the extensions were re-installing. After that it worked!
in my case , the extension wasn't enabled
I just had this happen (this being no code completion suggestions appearing). What resolved it for me was changing the VSCode Editor package in Unity to a previous version and then back to the current version.
For me, this was going from 1.2.0 to 1.1.3 and then back to 1.2.0. I believe removing and reinstalling 1.2.0 would have accomplished the same.
Window > Package Manager > Visual Studio Code Editor
I know this is probably the most obvious answer. But I had enough dealing with VS Code ridiculous bugs. You should be focusing on code, not the buggy IDE. Their documentation doesn't make it easy either to debug.
Steps for complete uninstallation:
Save your personalization files such as keybindings.json,
Just put it on GitHub or something so whenever you need have trouble with VS Code you simply just need to go to GitHub and copy-paste it.
Uninstall VS Code completely
When you uninstalled VS Code, it doesn't erase your extension files and some old settings. This is the cause of the re-installation ended up the same. Horrible move VS Code. For the list of the files that you must delete, you can check out this answer.
Go to their website and install the new one.
I hope this helps some people who are already had enough with the VS Code ridiculous bug.
In my case, the issue was not with VS Code settings. The error was due to a corrupted TEMP path configured in my PC's registry user profile environment settings.
I got this error from Help --> Toggle Developer Tools --> Console
The error was flagged in the console when I opened a new typescript file.
Unable to write file c:\Users\XXX\AppData\Local\Temp;C:\wamp64\bin\php\php5.6.25;C:\vufind-3.1.2\install.php\09cf49d8-af5b-42e9-8194-43f5b566be0f'
Obviously this path was corrupted. After updating the environment variables in registry settings, the VS code IntelliSense started working. Checking the console is a good start to find the root cause of this issue.
Earlier intellisense was working for Angular in VS-Code but for some reason (which I don't know) intellisense stopped working. I had extensions installed i.e. Angular Essentials and Angular Language Service etc. that were responsible for this intellisense and all that.
What I did?
I disabled the extensions, restarted VS Code and enabled them. It was all working fine as before.
If everything in VSCode is working ( No errors in output console, language server is working etc.) and built-in extensions are enabled. Still, if your IntelliSense is not working for normal .js files make sure variables are defined with a type identifier such as var d = new Date() or let d = new Date(). In my case, IntelliSense was not working for d = new Date() (No autocomplete for Date object 'd' APIs in this way) but started working fine when I specified a type before my variable names.
Download and install "Tool for Visual Studio 2019" as the C# extension under hood use the build tools: https://visualstudio.microsoft.com/downloads/
In my case, I had an extension installed (Explorer Exclude) to help me focus and hide certain files that I don't regularly work with within the Explorer.
I so happened to have disabled viewing *.sln, *.csproj and *.vsconfig files and folders, which apparently prevents VSCode from even knowing the file is there in the first place. Disabling these specific rules solved the problem instantly.
Took me ages to figure out... The more you know.
I solved it by uninstalling all SDK's (not sure if this is needed)
and installed 4.7.1 developer pack
win 10, vscode 1.63.2, unity 2020.3.25f1
I fixed this by installing .NET Framework 4.7.1 Developer Pack:
https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471
I downloaded setup.exe, and then begin to install and it immediately crashes.
On win7 it worked fine. On XP it doesn't work.
Error text:
Unable to install or run the
application. The application requires
that assemble stdole Version
7.0.3300.0 be installed in the Global Assembly Cache (GAC) first.
You'll need to include stdole.dll as a required file in your Publish settings in Visual Studio. Once you publish your app again, it should then include that file in your app when it's installed.
More info can be found here.
This happened to a few people that i had to install a click once application i developed. Basically something happened in their installation of .NET and the needed .DLL's were not moved to the GAC. It's very simple to fix, basically You need to copy stdole.dll from C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ to C:\Windows\Assembly ... that should fix your issue. Including them in the application isn't the best idea, this will fix it for ALL click once applications rather then just that one you are currently building.
P.S. Dragging the files to the location will work, you might get an error if you try to copy it.
I got this error today when trying to open a Visual Studio 2008 project in Visual Studio 2005:
The imported project "C:\Microsoft.CSharp.targets" was not found.
Open your csproj file in notepad (or notepad++)
Find the line:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
and change it to
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
This is a global solution, not dependent on particular package or bin.
In my case, I removed Packages folder from my root directory.
Maybe it happens because of your packages are there but compiler is not finding it's reference. so remove older packages first and add new packages.
Steps to Add new packages
First remove, packages folder (it will be near by or one step up to your current project folder).
Then restart the project or solution.
Now, Rebuild solution file.
Project will get new references from nuGet package manager. And your issue will be resolved.
This is not proper solution, but I posted it here because I face same issue.
In my case, I wasn't even able to open my solution in visual studio and didn't get any help with other SO answers.
For me the issue was that the path of the project contained %20 characters, because git added those instead of spaces when the repository was cloned. Another problem might be if the path to a package is too long.
In my case I could not load one out of 5 projects in my solution.
It helped to close Visual Studio and I had to delete Microsoft.Net.Compilers.1.3.2 nuget folder under packages folder.
Afterwards, open your solution again and the project loaded as expected
Just to be sure, close all instances of VS before you delete the folder.
This link on MSDN also helps a lot to understand the reason why it doesn't work. $(MSBuildToolsPath) is the path to Microsoft.Build.Engine v3.5 (inserted automatically in a project file when you create in VS2008). If you try to build your project for .Net 2.0, be sure that you changed this path to $(MSBuildBinPath) which is the path to Microsoft.Build.Engine v2.0.
I used to have this following line in the csproj file:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
After deleting this file, it works fine.
If you are to encounter the error that says Microsoft.CSharp.Core.targets not found, these are the steps I took to correct mine:
Open any previous working projects folder and navigate to the link showed in the error, that is Projects/(working project name)/packages/Microsoft.Net.Compilers.1.3.2/tools/ and search for Microsoft.CSharp.Core.targets file.
Copy this file and put it in the non-working project tools folder (that is, navigating to the tools folder in the non-working project as shown above)
Now close your project (if it was open) and reopen it.
It should be working now.
Also, to make sure everything is working properly in your now open Visual Studio Project, Go to Tools > NuGetPackage Manager > Manage NuGet Packages For Solution. Here, you might find an error that says, CodeAnalysis.dll is being used by another application.
Again, go to the tools folder, find the specified file and delete it. Come back to Manage NuGet Packages For Solution. You will find a link that will ask you to Reload, click it and everything gets re-installed.
Your project should be working properly now.
I got this after reinstalling Windows. Visual Studio was installed, and I could see the Silverlight project type in the New Project window, but opening one didn't work. The solution was simple: I had to install the Silverlight Developer runtime and/or the Microsoft Silverlight 4 Tools for Visual Studio. This may seem stupid, but I overlooked it because I thought it should work, as the Silverlight project type was available.
In my case, I opened my .csproj file in notepad and removed the following three lines. Worked like a charm:
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
<Import Project="..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.3.2\build\Microsoft.Net.Compilers.props')" />
ok so what if it say this: between the
gt/lt signs
Import
Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets"
/
how do i fix the targets error?
I also found that import string in a demo project (specifically "Build your own MVVM Framework" by Rob Eisenburg).
If you replace that import with the one suggested by lomaxx VS2010 RTM reports that you need to install this.
For errors with Microsoft.WebApplications.targets, you can:
Install Visual Studio 2010 (or the same version as in development machine) in your TFS server.
Copy the “Microsoft.WebApplication.targets” from development machine file to TFS build machine.
Here's the post.
This error can also occur when opening a Silverlight project that was built in SL 4, while you have SL 5 installed.
Here is an example error message: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" was not found.
Note the v4.0.
To resolve, edit the project and find:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
And change it to v5.0.
Then reload project and it will open (unless you do not have SL 5 installed).
For me, the issue was the path.. When cloning the project that had a space in the name. The project folder was named "Sample%20-%205" instead of what it should be: "Sample - 5"
Opening the project was fine, but building failed with
Could not find the file:
/packages/Microsoft.Net.Compilers.1.3.2/tools/Microsoft.CSharp.Core.targets
I deleted the obj folder and then the project loaded as expected.
Sometimes the problem might be with hardcoded VS version in .csproj file. If you have in your csproj something like this:
[...]\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets"
You should check if the number is correct (the reason it's wrong can be the project was created with another version of Visual Studio). If it's wrong, replace it with your current version of build tools OR use the VS variable:
[...]\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets"
I ran into this issue while executing an Ansible playbook so I want to add my 2 cents here. I noticed a warning message about missing Visual Studio 14. Visual Studio version 14 was released in 2015 and the solution to my problem was installing Visual Studio 2015 Professional on the host machine of my Azure DevOps agent.
After trying to restore, closing VS, deleting the failed package, reopening, trying to restore, multiple times I just deleted everything in packages and when I did a restore and it worked perfectly.
it seems now that the nuget packages folder has moved to a machine wide global cache, using VS2022
For me the issue was that the solution was to deep into the documents folder and on windows 10 there is a path character limit which was reached. As soon as I moved the solution folder up couple of folders this fixed the issue.