question

JayK-3872 avatar image
1 Vote"
JayK-3872 asked AgaveJoe commented

How can I create older version of web project for Asp.Net Core 2.2

hello!

I am developing a web app using ASP.NET Core.

  1. In order to improve server-side performance and responsiveness, we are trying to embed the server in charge of the user UI into the client app itself.

  2. I built Asp.Net Core 2.2 in Xamarin and confirmed that it works well, but I couldn't get a higher version from the nuget gallery. (I added the Dependency manually)

  3. By the way, I want to select Asp.Net Core 2.2 when creating a web project to use Razor Page support in Visual Studio 2019, but the option does not appear.



How can I create that version of the web project?

dotnet-xamarindotnet-aspnet-core-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,
Have you installed the .NET Core 2.2 SDK on your machine ? and what is your last version of Visual Studio 2019 ?
You can run this simple command ( `dotnet --list-sdks` ) in command prompt to getting list of the .NET Core SDKS if .NET Core 2.2 SDK not existed in the list you can download

https://dotnet.microsoft.com/en-us/download/dotnet/2.2


The version of .NET Core 2.2.8 is compatible with Visual Studio 2019 (v16.0) for more information just follow the link below

201963-capture.png

https://github.com/dotnet/announcements/issues/108#:~:text=The%20following%20table%20shows%20which%20Visual%20Studio%20versions%20and%20.NET%20Core%20SDKs%20are%20compatible%20and%20how%20they%20are%20acquired%20if%20you%20are%20working%20with%20Visual%20Studio.


0 Votes 0 ·
capture.png (156.2 KiB)

Hi, Have you found the solution of creating older version o the web project. Because I have to also create the older version of web for our Paki Packages company. As I am working here as a developer. But I haven't touched the older version of the web so I am quite confused. Kindly if you found any solution so also share with me so I could full fill the requirements of my job.


0 Votes 0 ·

1 Answer

AgaveJoe avatar image
0 Votes"
AgaveJoe answered AgaveJoe commented

Installed the 2.2 SDK which, by the way, is out of support.

https://dotnet.microsoft.com/en-us/download/dotnet

Then create an ASP.NET Core Web Application and select version 2.2 (Out of support).

201953-capture.png



capture.png (29.5 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Well, I would like to share with you some additional information I found about Xamarin X ASP.NET core embedding.

Creating the ASP.NET core 2.x Razor project.

Modify the project file to use the .NET standard 2.0 to glue with Xamarin.

Then, alter dependencies to remove incompatible Microsoft.AspNetCore.App package. (it built for .netcoreapp2.x but other packages are not)

Enjoy with Razor rendering on the client app.


<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
</ItemGroup>

</Project>


--> this could be imported by the xamarin project. (MonoAndroid11.0) with lots of warning messages.

0 Votes 0 ·

.NET standard and Core 2.2 are two different things.

https://docs.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0

I recommend going with the Core 6.0, and net standard 2.1.


0 Votes 0 ·