Not able to restore nuget packages/Manage nuget packages not working in visual studio 2017 - asp.net-core

I tried to open a .Net Core solution which was working fine in 2015. Recently they added some .Net Core projects to the solution and asked us to upgrade to Visual Studio 2017 to be able to run them. We installed Visual Studio 2017 and tried to open the solution, but I am not able to build it. I get the following errors when I right-click and try to select "Manage Nuget packages".
I tried to open the PackageManager console from Tools: even this is not working
I also performed the "repair Visual Studio" process too.

Finally i resolved it by deleting my nuget.config both at project level and also in %appdata%/roaming/nuget .I think the issue is because of broken config file due to change from visual 2015 to visual studio 2017 .Not sure about the exact issue though

Related

SSAS Tabular projects in Visual Studio 2022

I have installed the SSAS extension in Visual Studio 2022, it works well but it allows me to create Multidimensional projects only. "Analysis Services Tabular Project" is missing from the list. Any idea what's going on?
Thank you
You need to install it from the Visual Studio Gallery. It looks like there is a temporary workaround in the Q&A tab to resolve the issue you are seeing.
Uninstall AS extension.
install the AS extension and close the VS2022.
copy/replace the manifest file(link to download the file is below) in the SSAS folder, a location where your VS22 is installed. For
example "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSAS".
run the following command in cmd at a location where VS2022 is installed. For example "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE" command: "devenv.exe /updateconfiguration"
open visual studio and it should work fine.
if it still doesn't, make sure the AS extension is enabled and then execute the 3rd step again after closing VS.
link:
https://microsoftapc-my.sharepoint.com/:u:/g/personal/namangupta_microsoft_com/EdG1BxmX0W5OlLt4CHIZJqYB-8fXSocUi-zK5lqqBLURpg?e=rHCh9F
By Microsoft 3 hours ago
If you are looking for other extensions in 2022 this page has instructions and links.
Had the same problem with a old VS 2022 Version. Updating my VS 2022 to 17.3.4 an re-installing SSAS Extension was resolving the issue.
We now have a permanent fix for the issues. Please go ahead and update
your VS 2022 version to 17.2.5. You should now be able use Tabular and
Multidimensional Models.

Package [some package] is not compatible with netcoreapp

I recently installed Visual Studio 2017. I migrated the existing project which created in Visual Studio 2015. It got migrated without any errors. But when I build the solution I get 100+ errors stating Package [Microsoft.AspNetCore...] is not compatible with [netcoreapp...]
There are more than 100 items listed like this. I tried
renaming the sdk value in global.json
removing sdk value in global.json
repair, uninstall & reinstalling Visual Studio 2017. But none of them work.
I'm not sure where to add net451 in imports as explained here because the project.json file is deleted while migration.
The same project was working fine in Visual Studio 2015. All issues started after migrating to Visual Studio 2017.
Please let me know how to fix this error.
Due to your last comment I believe your problem is with the Nuget cache. I've seen this before where Nuget is pulling older packages after updating to .NET Core Tooling RTM and or VS 2017. To fix this run dotnet nuget locals --clear all. Then try creating a new .NET Core project.
You have to do this solution
open menu>project>'your project name'proprties...
in the opened window Application Tab change 'Target Framework' combo to '.Net Core 2.0'
now close the window and update again
enjoy it:)
If you are coming here after VStudio 2019 and you can't install the upgrade-assistant to get you to .net 5, upgrade your Visual Studio to 16.9+

TFS 2015 visual studio build task does not support VS 2017

We have a build definition in TFS 2015 that have worked fine with Visual Studio 2015 projects and solutions. We have now decided to upgrade to Visual Studio 2017 and thus we would like to target Visual Studio 2017 in the Visual Studio build task. We have installed Visual Studio 2017 on the build agent. Unfortunately the only options available int the Visual Studio build task are 2012, 2013, 2015 and Latest. We have tried latest but it does not find Visual Studio 2017 on the build agent. It won't work with the msbuild task either.
I have a similiar issue and resolved by installing VS2017 in my build agent server and configuring MSBuild to point to my MSBuild 15.0 folder:
Add MSBuild to your build steps
On the Advanced options, expand and fill the 'Path to MSBuild' like the image below:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
VS2017 RTM is released recently while TFS2015 was released before. That's why there is no VS2017 option in VS Build Task in TFS2015 Server. If you upgrade your server to the latest TFS2017, you would see "Visual Studio "15" (preview)" option listed in VS Build Task which is the version for VS2017 preview. And in the feature, the option will be updated to VS2017 which is the same as VSTS.
we are facing a similar issue and it is not possible for us to update ourselves as it is maintained on a company level where we cannot take that much influence.
However our team wanted to switch to VS2017 and make use of the C# 7 features. That's why we tried it as well with replacing the build steps from Visual Studio Build to MSBuild. Sadly this did not work as expected (we got some errors during the build).
As our main objective is to use the C# 7 features we looked for a way how to still achieve that at the time with Visual Studio 2015 remaining on the Build Server. We ended up using the nuget package Microsoft.Net.Compilers that, when used in a project, will use that compiler instead of the installed one.
More on this can be found in this Thread.
It seems the updates to the build tools are installed via the command line of the VS2017 installer.
See the docs for details.
Just adding another thing: if you're using custom build template make sure to edit it and modify the ToolPath attribute value to:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin

Visual Studio 2015 - Add New Item: "No items available for Templates"

The ADO.NET Model Templates are missing in my version of VS2015. I have tried installing the SQL Server data tools and re-installing the EF Tools as per suggestions found elsewhere but neither have helped. Does anyone have a solution for this issue?
Many thanks
I fixed the same problem in the following way
got to the Control Panel -> Programs and Features -> Right click on Visual Studio 2015 -> Modify -> (tick the feature "Microsoft SQL Server Data Tools" ) and Update
give it a try
I was getting the No items found message when attempting to simply add a new class to my project, and managed to fix it using the steps provided by this blog post by Kevin Wilson
Close Visual Studio
Remove (and backup) the following directories from your Visual
Studio installation.
VisualStudioInstallDir\Common7\IDE\ItemTemplatesCache
VisualStudioInstallDir\Common7\IDE\ProjectTemplatesCache
Run command prompt as administrator, and navigate to the Visual Studio directory, e.g.
cd C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7IDE
Run the following command to regenerate the item and project template caches
devenv.exe /InstallVSTemplates
Restart Visual Studio, and if everything's worked, your class & project templates should all be working normally again.

Visual Studio 2015 - a lot of Packages are missing

So I recently bought a new computer. And now I wanted to install visual studio 2015. So I did. But now the problem is that i cant create a new project because i cant select a vb.net form or anything else and also im getting these error messages saying:
The 'ErrorListPackage' package did not load correctly
The'VisualStudioPackage' package did not load correctly
The Microsoft.visual studio package did not load correctly
anyone has a solution for this? because I'm kinda getting a bit frustrated now.
I tried a complete uninstall and install and it didnt work. I tried copying folders from my laptop to my new pc but also that didn't work. Also switching frameworks doesn't do anything. I also never experienced this problem before but can this problem occure because I have 2 drives?? Seems odd but I think I'm also going to do an uninstall again and then try the .iso installer and see if that helps.
So this is how I fixed it for myself.
I removed all files and folders that are linked to visual studio
C:\Program Files\Microsoft Visual Studio 12.0
C:\Program Files (x86)\Microsoft Visual Studio 12.0
C:\Program Files (x86)\Microsoft Visual Studio 14.0
C:\Users\name\AppData\Roaming\Microsoft\VisualStudio
C:\Users\name\AppData\Local\Microsoft\VisualStudio
C:\Users\name\AppData\Local\Microsoft\VisualStudio Services
C:\Users\name\AppData\Local\Microsoft\VSCommon
C:\Users\name\AppData\Local\Microsoft\VsGraphics
After I deleted all of those folders I deleted the regkeys located:
HKLM > SOFTWARE > Microsoft > Visual Studio
After that I started the visual studio installer with admin rights.
And now I can create a project :)
This usually indicates an issue with an extension which ships with some dependent assemblies which Visual Studio itself (or another extension) also depends on. When these dependencies are different versions, it's not predictable which version will load.
To solve your problem, first disable your extensions and add-ins, then close Visual Studio, clear the ComponentModelCache folder under:
C:\Users\{username}\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
And start Visual Studio again.
This should clear the immediate issue.
Now enable each extension one-by-one restarting Visual Studio every time to see if the issues come back.
To dive deeper into the underlying issue, you could look into all the extensions under these folders:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions
C:\Users\{user}\AppData\Local\Microsoft\VisualStudio\12.0\Extensions
Look for assemblies from Microsoft itself (commonly found are Microsoft.TeamFoundation.* and Microsoft.VisualStudio. in folders containing an extension that did not originate from Microsoft. These extensions are common culprits for these issues.
If you want to dig deeper, consider using fuslogvw from the Windows SDK to see which assemblies are loaded and which exact versions they are. You can also look into the Visual Studio logs after the issue surfaces to see what underlying cause there may be. The log should be available under:
%AppData%\Microsoft\VisualStudio\14.0\ActivityLog.XML