Visual Studio 2017 not installing packages for new projects - asp.net

Recently installed Visual Studio 2017.
Usually, when you create a new project, you immediately fire it up and run the scaffolded code.
Unfortunately for me, the new project doesn't have the required packages making the build fail.
Also, objects in the code are marked as not recognized. This is also correct for javascript dependencies.
4 new projects of different types, same result. Didn't even change the code yet I can't build.
The light bulb icon doesn't even show the dependency. Visual Studio doesn't recognize it.
How come scaffolded code has missing references??
Please help.

Well, this was annoying...
Package restore was disabled.
Enabled it in Visual Studio's options and ran the project.
Packages appeared magically.
Tools > Nuget Package Manager > Package Manager Settings

Related

NuGet spec command ignoring metadata from project properties

I am generating a NuGet package of a library in .NET Standard 2.0 using Visual Studio 2022.
I go to Project properties and edit the project information as shown in the pictures.
When i use the command NuGet specto generate the manifest, the values are not corresponding to the project metadata edited in Visual Studio.
I tried several solution found on web but none worked, even unloading the project, reloading and cleaning it. It looks like nuspec is ignoring the properties of the project.
I know I can edit the metadata by hand, but I am wondering why this happens. If I make several rebuild of the package I have to edit manually the entire spec file each time.
I have found out that there is no need to call NuGet spec and follow the manual procedure in order to create a package in Visual Studio 2022.
In Visual Studio 2022, it is enough to right-click the project and select Properties.
Then in the Package section, check the box Produce a package on build.
A NuGet package of the project, using the metadata provided in the project properties, will be created in the bin/Debug or 'bin/Release` folder. The folder depends on your building choices.

Razor Runtime Compilation

ive been having trouble trying to install razor runtime compilation and i continue to get a fault. i updated the vs2019 community edition and was able to click on the checkbox to add the "runtime compilation". when the project is loading, it doesnt install the "razor runtime compliation" package. it doesnt allow me to search for it via NuGet anymore either.
I tried my best to search around and some made it seem very simple to just install it from the pack manager or NuGet. Im using asp.net core 3.1 and vs2019 16.6.1 community edition.
EDIT: HOW CAN I INSTALL ...razor.runtimecompilation.i have not been able to figure out a solution to the error.
"Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
This package is from nuget.org in my visual studio. While from your screenshot, it retrive from http://packagesource. Maybe you should configure your package source:

Visual Studio 2019 Doesn't seem to see that I have .NET Core 3.1 Installed (with SDK)

I just installed Visual Studio a few days ago and for some reason I can't create anything but a class.
When I go to create a new User Control the pop up window lets me do everything except for click the "Add" Button to close the window and create the control.
If I double-click the User Control selector to create automatically, it pops up an alert box that says I need to go to the installer to get the .NET Framework target libraries. But when I go to the project's properties I see that I am already targeting .NET Core 3.1 and the only other option I have to target is .NET Core 3.0.... I assume this is because I'm in a .NET Core WPF application but I have no idea why it won't let me create a new control. It won't let me create anything except for a new class.
What is going on here? How can I work around this bug?
I've faced your problem recently. most of the templates were not installed after installation.
something you have to do is Modify your installation.
open Visual Studio Installer and click on Modify then choose the features(.Net core,Asp.net, Desktop Application and etc) in order to re-install them.
keep it in mind that, if installer encounters any problem or missing dll. installation instantly will be completed that should not happen.
keep your eyes close to your installer process and make sure all packages are installed.
a successful installation MUST not have any warning otherwise there are packages not installed.
it's better to install packages one by one NOT totally. I mean if you want the Asp.Net Core feature then try to install it at first. then try to install another feature.
Actually, I was not able to install whole features in a single installation and I don't know why. in short, don't heavy your installation.
If the problem still exists then:
1. Close all open solutions
2. Run InstallCleanup.exe
C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe
3. Remove all existing Visual Studio programs from Control Panel -> program features
4. Restart pc and re-install Visual Studio
5. Make sure you have connected to the network
6. Choose only one feature(Don't select all) to install + Visual Studio Editor
vs bug
Extensions don't work properly in VS 2019 and make it hang. it's may happen because the Extensions have to be updated to be compatible with vs 2019 or it's vs bug.

Shared namespace not being recognized in Blazor Server project

I am trying to build a Blazor Server project that I have cloned from a repo. I am getting the message in the Output window of Visual Studio 2019 that the Shared namespace does not exist. The Shared namespace is created in the Blazor template and was not something I added to the project. This also happens if I create a new project and try to run it. Others on my team are able to clone this repo and run it. I have uninstalled and reinstalled Visual Studio 2019 Enterprise edition and also the Dotnet 3.0.1 framework. The only thing I can think that might be the difference is that I updated my VS 2019 to 16.3.10, but even after uninstalling and reinstalling, I have the same issue. I know I have read some things about mismatching of VS and Dotnet core framework SDK versions causing issues but not sure if this is the case here.
I was able to resolve this issue by rebuilding the project after clearing Nuget Caches.
Path: Tools -> Nuget Package Manager -> General -> Clear all Nuget Cache(s).

Visual Studio 2017 15.7.2 - ASP.NET Core Application is missing

I installed the Visual Studio 2017 Enterprise and updated it to the last version. I choosed the necessary web components in the Visual Studio Installer, tried to execute the devenv /InstallVSTemplates, tried to repair Visual Studio and installed .NET Core SDK (x86 and x64).
Nothing of this helped me, I still can't find the ASP.NET Core Application under .NET Core in Visual Studio. How can I solve this problem?
Solution that I found myself: Everything described above was indeed caused by a mistake in the third screen.
I did not find how to solve this problem automatically, I just installed all these .msi packages manually. The installer loads them, but for some unknown reason can not install it themselves. To install them manually, you need to go to the directory where Visual Studio is installed, there just look for these packages by name and install them. Then you need to run the installer again and if it shows another error with another package, you need to repeat the procedure with a manual installation. I had to repeat it three times with three different packages. After that, I started the installer once more and it installed the rest.

Resources