0

After reading Servicestack web pages, I come to the conclusion that running the following command would create an (ASP).NET Core web project:

web new web-corefx ProjetName

However, when I do that, I get an INFO saying:

D:\test>web new web-corefx Test
Installing web-corefx...
INFO: Could not find files for the given pattern(s).
running dotnet restore...
  Restore completed in 576,34 ms for D:\...\Test.ServiceModel\...
  Restore completed in 761,72 ms for D:\...\Test.ServiceInterface\...
  Restore completed in 802,11 ms for D:\...\Test.Tests\... 
  Restore completed in 1,24 sec for D:\...\Test\Test\Test.csproj

Test web-corefx project created.

When I open the project in Visual Studio 2019, I see this:

enter image description here

... which tells me that a .NET Core project was not created.

Just to be sure that .NET Core 3 is installed and working, I created a "ASP.NET Core Web Application" via the "Add new projet" dialog, and then it shows up as expected:

enter image description here

Have I misunderstood how to use the "web" CLI command?

UPDATE

I also tried the x new command, like so:

x new web-corefx TestProject

and it gives me the same problem - a .NET Framework 4.7 project instead of the expected .NET Core.

However, running just x new web TestProject gave me a .NET Core project, but not of the template I wanted...

2
  • Ehm, not clear at all, in my opinion. An ASP.NET Core website, but not running .NET Core? Commented Feb 3, 2020 at 6:29
  • I might be confused as to what the difference is between ASP.NET Core and .NET Core, but this SO post (stackoverflow.com/questions/44136118/net-core-vs-asp-net-core) says that "Do note that ASP.NET Core 3 and higher now depend on .NET Core and can no longer be used on .NET Framework". So, the docs on ServiceStack mention "ASP.NET Core Framework Templates", which sounds to me like its running on .NET Core. Commented Feb 3, 2020 at 6:41

1 Answer 1

1

Please read the ServiceStack Template Docs you linked to closely. The project templates ending with -corefx all create ASP.NET Core Apps on the .NET Framework.

ServiceStack .NET Core C# Project Templates are in the first group, so if you wanted to create an empty .NET Core web project you would drop the suffix, e.g:

$ dotnet tool install --global x 
$ x new web TestProject
Sign up to request clarification or add additional context in comments.

2 Comments

I did read those docs. It says "ASP.NET Core Framework Templates" and under that heading, it says "web-corefx". So, ASP.NET Core Framework I thought was exactly that, running .NET Core. reading on the section before, ".NET Core C# Templates", it sounded to me like ASP.NET Core was more correct. So, it wasnt clear to me at all. But thanks, that resolved it.
@Ted ASP.NET Core is the Web Framework, .NET Core is the runtime. ASP.NET Core on the .NET Framework means running on the .NET Framework not the .NET Core runtime.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.