Can I use a Visual Studio ASP.Net 5 template with ASP.Net 4.6?

I really like how the new VS 2015 ASP.Net 5 templates customize the client-side build system. It keeps client-side system components from working folders by publishing only the final assets in the wwwroot working folder.

I need to create a new project using ASP.Net 4.6, but I would like to configure the same build system for node dependencies and bower / gulp components.

Can I convert an empty ASP.Net 5 project to use ASP.Net 4.6 in the same split form?

+5
source share
2 answers

Can I convert an empty ASP.Net 5 project to use ASP.Net 4.6 in the same split form?

The short answer is yes, it is possible.

While there are different versions that have different templates, you can technically achieve what you are looking for by creating your own template.

Visit one of the two MSDN links below to create custom templates step by step:

A slightly longer answer is yes, but with some noteworthy reservations.

In Visual Studio 2015, select File > New Project > Installed > Templates > Visual C# > Web > ASP.NET Web Application , then select ASP.NET 5 Templates . "

New ASP.NET Project - Web Application

Open the project.json file and change the frameworks to this:

  "frameworks": { "dnx451": { }, "dnxcore50": { } }, 

For this:

  "frameworks": { "net46": { } }, 

Now you have the desired template oriented to the .NET 4.6 runtime. One important point and disclaimer is that even if you are targeting .NET 4.6 , it is not ASP.NET 4.6 , in fact it is still DNX and uses the latest ASP.NET Core 1.0 libraries, it happens what do you instruct him to run on top of the well-known .NET 4.6 runtime.

ASP.NET Core 1.0 (formally known as ASP.NET 5 ) is a complete rewrite and is still only located in RC1 as of 3/9/2016. With that said, much more support and IDE tools are yet to come with RC2 and the final release. It should be understood that ASP.NET Core 1.0 not ASP.NET 4.6 .

+8
source

I think you can’t. Each version of Asp.Net has its own template. But you can find an Asp.Net 4.6 template on the Internet that looks like an Asp.Net 5 template (if the design and structure is what you mean)

+1
source

Source: https://habr.com/ru/post/1236500/


All Articles