.NET Blazor Build error - asp.net-core

I have tried to run the out of the box Blazor application to try out C# WebAssembly. I am running into issues when trying to run it different ways. I have also tried to hack the runtimeconfig.json according to this https://github.com/dotnet/cli/issues/7543
Running IIS Express
Running BlazorApplication1
The program '[42032] dotnet.exe' has exited with code -2147450749 (0x80008083).
Running in command line
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0-preview3-25512-01' was not found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '2.0.0-preview3-25512-01'.

You need to have the 2.1 preview of the .net core framework installed for Blazor to work: download here

Related

How to build application targetting .Net 4/4.5 on CentOs

I have a lot of legacy code that builds fine on Windows with .Net 4.5
I am trying to build the same on CentOS with dotnet-sdk for automation and licensing issues.
Following the Microsoft link after installing the required packages, this command fails
$ dotnet msbuild sharpTest.sln
/usr/share/dotnet/sdk/5.0.301/Microsoft.Common.CurrentVersion.targets(1216,5): error MSB3644: The reference
assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack
(SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework
Developer Packs at https://aka.ms/msbuild/developerpacks
Since I installed dotnet-sdk-5, it seems the solution fails to build. But I could not locate .Net framework 4 for CentOS
How do I resolve this ?
It's referencing .NETFramework. .NETFramework V4.0 is not xplat and therefore not available on anything else than windows. You should try to re-target your solution to net5.0 and make it independent of Windows specific dependencies.
To re-target to net5.0 try the dotnet upgrade-assistant (it's a dotnet tool). Do this on a windows machine first. To address any windows dependencies that won't work outside windows or .NetFramework see the Overview of porting from .NET Framework to .NET

HTTP Error 500.31 - ANCM Failed to Find Native Dependencies

I upgraded an existing application from asp.net core web API 2.0 to 3.1. When I run the application locally, application runs fine without any errors, but when I deployed the application to the same server where the 2.0 application was running, I got an error saying "ANCM failed to find Native dependencies".
Below is the screen shot:
From the provided link:
https://dotnet.microsoft.com/download/dotnet-core/3.1
I was able to find out that I need to install .net core 3.1. I am not sure if I need to install on my server:
ASP.NET Core Runtime 3.1.3
OR
SDK 3.1.201
I already have few 2.1 applications running on the server so I don't want the older applications to stop working if I upgrade to 3.1 . I have IIS installed on the server. Its a Microsoft windows NT version 6.2 DataCenter edition terminal server and my application that I am trying to deploy is .net core 3.1
I just wanted to know whether I should install ASP.NET Core Runtime 3.1.3 or SDK 3.1.201
and installing any of these on the server wont affect the applications that are running on 2.0 .net core framwork.
any help will be apprecaited.
Each .NET Core will define which version it uses and will use that SDK or runtime. Installing another SDK or runtime will not impact previously installed versions.
If your just hosting and not doing any development on the server then you only need to install the runtime. If any development will be taking place you will need the SDK.

HTTP Error 502.5 - Process Failure in .Net core 1.1

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
Check application dependencies and target a framework version installed at:
Alternatively, install the framework version '1.1.2'.
I installed Windows (Server Hosting) installer and Runtime Installer 64-bit but still facing this issue
I tired all possible solutions but nothing is working for me
please help me!
Thank You
Try running your website from the command line with command below:
dotnet YourWebApp.dll
This way you'll be able to see any errors which may be preventing your website from starting. You can then follow the erros shown and look for their specific fixes.

DNX SDK version "dnx-clr-win-x86.1.0.0-preview2-003131" failed to install

I am not understanding why am I getting above mentioned error while loading some new pulled project from tfs. Even though I have Microsoft DNX folder in my explorer it asks me to install DNX SDK and when I install it fails.
I tried updating visual studio also but it didn't work.
Can anyone help me with this?
Since I use VS 2015, above mentioned issue resolved for me by downloading specific .Net Core version from https://go.microsoft.com/fwlink/?LinkID=827546 . It gives you DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe
You can get other related .Net Core SDKs from https://www.microsoft.com/net/download/core
If you have VS 2017, you don't need to install .Net Core SDK explicitly. You get it by default in VS 17.
Cheers!

"dotnet new" command fails on fresh installation of OS X 10.11.6 OS X El Capitan

I have installed the dotnet-core for OS X using the dotnet-osx-x64.1.0.0.pkg from the official download section. - https://www.microsoft.com/net/download
Running "dotnet new" command gives the below output
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
How to create the basic .net-core project?
I have run the below commands on the user directory without success
echo 'export PATH="$PATH:/usr/local/share/dotnet"' >> ~/.bashrc
and
Created a vi .bash_profile and inserted the below command
export
PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/share/dotnet
Still the below command fails
dotnet new
This is the version of the .net-core I have
dotnet --version
gives below output
Microsoft .NET Core Shared Framework Host
Version : 1.0.1
Build : cee57bf6c981237d80aa1631cfe83cb9ba329f12
dotnet-osx-x64.1.0.0.pkg is the package containing just .NET Core, basically the runtime.
In order to develop applications, you need the .NET Core SDK. This is also what the error message you see says:
Did you mean to run dotnet SDK commands? Please install dotnet SDK […]
The download website also explains the difference as follows:
You probably only need to download one of these:
.NET Core SDK = Develop apps with .NET Core and the SDK+CLI (Software Development Kit/Command Line Interface) tools
.NET Core = Run apps with the .NET Core runtime
So, just download the .NET Core SDK package for your platform instead. For mac OS, this currently is dotnet-dev-osx-x64.1.0.0-preview2-003121.pkg.
You can also just follow the instructions on the .NET Core quickstart page which gives you detailed step-by-step instructions on how to get .NET Core running properly.