Missing visual studio 2019 blazor webassembly app template - visual-studio

I updated my vs 2019 16.3.10 to 16.4 and .net core 3.0 to .net core 3.1 but the blazor web assembly application template is missing.

Try the following to install the latest Blazor WebAssembly template. Run the following command:
dotnet new --install Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview3.20168.3
Get the latest version here. It's free...

In command line run:
dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.1.0-preview2.19528.8
cd C:\Users\Username\Documents\MyWebSites\BlazorWebAssySite1
dotnet new blazorwasm
Open VS2019, choose open project and find BlazorWebAssySite1 folder. Done. For new projects just create a new project folder and run the last command.
Have also a look at this video: https://www.youtube.com/watch?v=bophIr--1QY .

Related

Installed .net Framework and it does not appear in Visual Studio

I installed .Net Framework 6.0 from https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=getdotnetsdk. I rebooted. When I open VS 2019 and try to config a project that version is not in the list.
When I run dotnet from a command prompt I get:

How to add Identity Scaffolding to an ASP.NET CORE Applicationon using Rider IDE

I'm watching a tutorial about ASP.NET CORE Identity,In it the instructor add identity by scaffolding it using Visual Studio, but right now I'm using Rider IDE and i'm not seeing such option on it, so i believe is a exclusive feature of Visual Studio.
So is there a way to implement it on Rider IDE? or I'm forced to do it on Visual Studio and then come back to rider again?
From the Terminal in Rider (default located at the bottom of the IDE) you can run the following commands (Full Reference).
dotnet tool install -g dotnet-aspnet-codegenerator
If you've already got the dotnet-aspnet-codegenerator tool installed, you may need to update it:
dotnet tool update -g dotnet-aspnet-codegenerator
Make sure you're switched in to the project directory if not already (not the solution root, cd ProjectName.
Then install the Microsoft.VisualStudio.Web.CodeGeneration.Design package either via the NuGet tab, or the command line (dotnet add package Microsoft.VisualStudio.Web.CodeGeneration.Design).
Then run the following to generate default project:
dotnet aspnet-codegenerator identity
The Identity Area will be populated with both Data and Pages folders in your project.
A real world example (with an existing DbContext and using Sqlite) is:
dotnet aspnet-codegenerator identity -dc ApplicationDbContext -gl -sqlite -f

Visual Studio not recognizing installed Core SDKs

I have three versions of .NET Core installed on my machine:
However, both VS2017 and VS 2019 return the following error when I execute dotnet --version command:
PM> dotnet --version
dotnet : Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
I can create a solution targeting .NET Core but when I create a Console App targeting .NET Core, for example, the Debug button is labeled Attach instead of Start as usual, and Start Debugging and Start Without Debugging commands in the Debug menu are disabled.
What I tried so far:
Added "C:\ProgramFiles\dotnet" to system PATH variable.
Modified VS2019 using VS Installer.
Restarted several times.
I did have several other version of .NET Core but uninstalled them since I had no solutions targeting these versions and wanted to clean up.
I only left 2.2.300 and 3.0.100 and when I used VS Installer to modify VS2019 it added SDK 2.1.700.
Any ideas on how to resolve this issue without completely removing Visual Studio and installing from scratch?
Apparently x86 version(s) of .NET Core SDKs must be installed as well. After installing 3.0.100 x86 dotnet --version command works fine and I can build and debug .NET Core projects...

How do I get Ionide to see .net core Linq and AspNetCore namespaces?

I recently installed dotnet core 1.0.0-rc4-004771. After generating a new fsharp project with the following command: "dotnet new mvc -lang f#"
Ionide complains that it can't find the Linq and AspNetCore namespaces even though "dotnet build" builds just fine.
Has anyone else run into this issue?
should be fixed now, with
ionide >= 2.25.1
.net core sdk rtm (1.0.1)
see https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-1.0.1 for more info
dotnet new mvc -lang f#
dotnet restore
code .
restore can be done after open code too, but is required to make intellisense work

What determines whether my .net core uses .csproj or project.json

I've got a machine with .NET Core 1.1.0 1.0.0-preview2-1-003182 installed as well as VisualStudio 2017 RC. When I create a project using "dotnet new -t Console" it requires a project.json file. When I create a .NET Core ConsoleApp in Visual Studio 2017 it requires the .csproj for build configuration. What determines this? I'd like to have one or the other, preferably consistent .csproj since project.json is deprecated for future versions as far as I can tell.
VisualStudio 2017 RC won't seem to build a self-contained executable, so I revert to the command line to attempt a "dotnet publish -t win10-x64" whereby I get the error that there is no project.json. So, even if I have my .csproj configured to build an .exe, I can't just build it.
The version of .NET Core Tools is the reason:
.csproj is used starting from .NET Core Tools Preview 3
Note: Visual Studio 2017 RC installs .NET Core Tools Preview 3 (or even Preview 4 now).
project.json is used in previous versions.
If you want to know with version of .NET Core Tools is used then go to root project folder and run next command:
dotnet --info
Possible output:
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
If you have more then one version of .NET Core Tools on your machine, you can directly specify with version should be used for your project by global.json. Create (if not exists) this file in root folder and add "sdk" section. For example for Tools Preview 2:
{
...
"sdk": { "version": "1.0.0-preview2-1-003177" }
}
Also you may use dotnet-migrate command to convert your project.json to .csproj

Resources