Mobile blazor bindings - xamarin.forms

Can I use .net standard 2.1 with the last Mobile blazor bindings -Version 0.5.50-preview? I also want to use Xamarin forms 5 in the project. Is it possible to use Mobile blazor bindings with the Xamarin Forms 5?

Yes you could.
To get started, all you need is the .NET Core 3.0 or 3.1 SDK, Visual Studio or Visual Studio for Mac, and the ASP.NET and web development and Mobile development with .NET (Xamarin.Forms) workloads installed.
Install the templates by running this command from a command/shell window:
dotnet new -i Microsoft.MobileBlazorBindings.Templates::0.5.50-preview
And then create your first project by running this command:
dotnet new mobileblazorbindings -o FirstMobileBlazorBindingsApp
Open the solution (SLN file) in Visual Studio and mark either the Android or iOS project as the StartUp Project.
The more you could refer to the official doc.

Related

ASP.Net Core WebApi Project creates an empty solution

I am trying to create a ASP.Net Core WebAPI application, i installed every sdk and runtime i was told to.
I then go into Visual Studio and create the Project from the ProjectCreator.
What I end up with is an empty solution and a project in the specified directory that i cannot open, with the error message the Project cannot be opened because it couldnt find a fitting sdk
(btw, creating it with .netCore3.1)
Heres a list of my installed sdks/runtimes:
.NET Core Runtime 2.1
.NET Core Runtime 3.1
.NET Core SDK 3.1.1
.NET Core SDK 3.1.4
.NET Runtime 5.0
.NET SDK 5.0.2
.NET SDK 5.0.3
ASP.NET Core 3.1.17
ASP.NET Core 5.0.8
This is what my solution explorer looks like tho the csproj is correctly placed
Whats seems to be the problem? Too many runtimes/sdk?
Are they overriding each other? Visual Studio cannot choose? I am baffled, this should work :/
[Edit1]
This is the guide I am following: https://learn.microsoft.com/de-de/aspnet/core/tutorials/first-web-api?view=aspnetcore-5.0&tabs=visual-studio
[Edit2]
I found a command that lets you see every sdk and runtime the dotnet/cli can access/see
(dotnet --info)
Looks like dotnet doesnt seem to find an sdk i installed
[Edit3]
I tried to manually install the .net core SDK 3.1 binaries into the C:\ProgramFiles\dotnet folder, but to no avail, dotnet --info still doesnt recognize the SDK
[Edit4]
I got it working, I will post the solution as an answer.
Heres what I did:
I uninstalled my Visual Studio IDE with the Visual Studio Installer
I uninstalled every .NET (Core) SDK and .NET (Core) Runtime
I did a fresh Visual Studio install with only the components i really need
After that I checked the dotnet --info command and there was it, 2 SDKs were installed. When I create the WebAPI Project now, the Solution Explorer has a project and I can finally see all files. This was weird. Thanks everyone tho!

How to run .NET framework project with VS Code, which has dependency of ReactJS?

I am beginner to .NET framework and ReactJS. I have a code repository which is .NET framework, with ReactJS dependency.
When I opened the repository, VS Code suggested me to install C# extension, I installed.
Now when I opened the main file abc.csproj; it automatically started installing packages.
It ended with message:
Finished
Failed to spawn 'dotnet --info'
and notified:
The .NET core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on path.
What is process and list of extensions if I need it to be ran in VS Code?
P. S. It is a .NET framework 4.5 project and not core .NET project
The C# extension no longer ships with an included Mono & MSBuild Tools...
If you still need Unity or .NET Framework support, you can set
omnisharp.useModernNet to false
in your VS Code settings and restart OmniSharp.
See issue #5120 for more details.
https://github.com/OmniSharp/omnisharp-vscode/issues/5120
it seems you don't have the .net framework SDK installed on your machine.
you can download and install .net sdk from here : https://dotnet.microsoft.com/download/visual-studio-sdks to be able to build .net framework projects
I will suggest to use Microsoft Visual Studio. I am using it and it's good and dragless rather than getting SDKs and having installation troubles.

Microsoft Visual Studio console asking for dotnet sdk even if it is installed

I've installed Microsoft .NET Core SDK with Visual Studio 2019 but whenever I am debugging an Azure function, the debug console is asking to install the dotnet sdk:
click to enlarge
click to enlarge
Azure function v2 is based on .Net core 2.2.
Have a look of this document:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-versions#languages

asp.net web application template is missing visual studio 2017

I have visual studio 2017 enterprise edition but asp.net web application template is missing. I have asp.net core 2 installed on my machine.
here are the installed components
It was there but dont know how they got removed.
Please suggest me how can i see web application template and asp.net mvc templates?
Thanks
After you select a project type of Web Project then click OK you will be taken to a dialogue which will allow you to select the web project type:
For .Net Framework:
For .Net Core:
I encountered the same issue in Visual Studio 2019 and upgrading / repair did not work. However, there is dotnet new that is very easy to use and requires less time than trying to fix VS templates. Example:
default project creation (preview)
dotnet new mvc --dry-run
help related to various options such as authentication (None, Individual etc.)
dotnet new mvc --help

TFS 2017 Deploy ASP .NET Core

We are on TFS 2017 initial release (on premise install). I am looking to see how I can build ASP .NET Core 2.0 apps using TFS 2017 Build / Release. Right now our standard builds uses Visual Studio builds and we have visual studio 2015 installed on our build server.
When I am attempting to build ASP .NET core 2 MVC app, using Visual Studio build, the build is failing with an error message :
Trunk\xxxxxx.csproj (1, 1)
Trunk\xxxxxx.csproj(1,1): Error MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to the element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format.
Can I ask what is the recommended approach to building / deploying .NET core 2.0 projects using TFS 2017?
Install VS 2017 on the build server? We already have VS 2015 installed on the build server. Can VS 2015 and VS2017 live side by side on the build server and will the VS build step pick up 2017?
Visual Studio Builld
Or should we be installing .NET core 2.0 SDK on the build server and then use command line utility as a part of the build step.
Or should we switiching to MSBUILD instead of VS studio build and installing just the MSBuild for VS 2017 on the builld server.
1.You could install VS2017 on the build server. VS2017 and VS2015 could live side by side on either a build server or a develop machine. You just need to select which version you will use in visual studio version picklist. However VS2017 option is not support on the build-in Visual Studio Build task on TFS2017. It's not related to VS2017 installed on the build server or not.
2.You need to install .NET CORE 2.0 SDK on the build server, otherwise will get a similar error as below:
error : The version of Microsoft.NET.Sdk used by this project is
insufficient to support references to libraries targeting .NET
Standard 1.5 or higher. Please install version 2.0 or higher of the
.NET Core SDK.
Highly recommend you to keep the build server environment as same as local develop machine, this will narrow down the build issue on TFS.
3.No you don't have to. Just follow the process in this tutorial-- Build your ASP.NET Core app
Suggest you update your TFS 2017 initial release to the latest version TFS2017 update2. This will include VS2017 in the picklist of vs version. And since .NetCore 2.0 released in May 2017 which is later then the initial TFS2017(November 2016), not sure if it's supported or have any other issues. However, one thing is certain: you could build .NET Core 2.0 apps in TFS2017update2 successfully. Moreover, there are many new features released with update2 version, there is no reason to stay on the initial TFS2017.

Resources