Hi everybody,
how to hosting the complete source code on iis with aspcore 3.0?
For asp.net mvc5:
I can host the complete source code on iis without having to publish the project. This is great for editing web layouts or assigned for frontend to editing in some cases.
however for aspcore project, I have to publish the project to be able to host on iis. The problem is that the cshtml files are all encrypted into ddl files.
This is not good for flexible editing of the project after publishing.
The question is, is there any way to host an aspcore project without publishing it?
or publish and still keep cshtml files?
Please discuss and give me advice.
My English is not good, I hope everyone does not mind.
This is not good for flexible editing of the project after publishing.
In place editing (something popular before 2000) has been replaced by CI/CD in the past decades, which not only offers the same flexibility, but also enforces important rules like quality check.
Follow the trend, and don't go against it.
Lex Li
https://lextudio.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
I don't see why you cannot connect the VS Web project to local IIS and run the project code on local IIS, just like you can do it using IIS Express. I bet the cshtml files are not encrypted in the VS project. It's not about debugging. It is the ability
to run the Web project on local IIS without having to publish the project to IIS.
Imagine, you are publishing the website to your customers.
After a while, your customers need to revise the web interface (just a bit). But the source code for this project was lost for some reason.
If the host has cshtml files, your frontend can edit these files without the entire project source code.
Why are you trying to publish the project only to turn around to do something with the HTML that is in a DLL? Just push the Web project out off of the Web project's properties to local IIS using VS. That way, the HTML in the cshtml files are still in string
format and you can manipulate them while in development mode.
I am sure you manipulated the cshtml files in the project while it was configured to use IIS Express in Visual Stuido.
If you find the post has answered your issue, then please mark post as 'answered'.
If the host has cshtml files, your frontend can edit these files without the entire project source code.
If you want the frontend could edit .cshtml file,you could create a child site in your main site about these files and update the child site by using command line.
For hosting on IIS without compiling to .dll file, As mgebhard said,It is impossible.
Best regards,
Rena
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Imagine, you are publishing the website to your customers.
After a while, your customers need to revise the web interface (just a bit). But the source code for this project was lost for some reason.
If the host has cshtml files, your frontend can edit these files without the entire project source code.
do you have any ideas?
You expect to lose your customer's source code? The solution is pretty simple... target a framework that has the features you want.
Imagine, you are publishing the website to your customers.
After a while, your customers need to revise the web interface (just a bit). But the source code for this project was lost for some reason.
If the host has cshtml files, your frontend can edit these files without the entire project source code.
do you have any ideas?
this really goes against the asp.net core model. the old asp.net framework with its AspNet_Compiler was designed this way (all source files on server and compiled at run time). If this design is you desire, you should pick a different framework rather than
asp.net core. Try node.js, python, ruby or php.
Member
5 Points
48 Posts
how to hosting the complete source code on iis with aspcore 3.0?
Dec 22, 2019 02:57 PM|sonht10|LINK
Hi everybody,
how to hosting the complete source code on iis with aspcore 3.0?
For asp.net mvc5:
I can host the complete source code on iis without having to publish the project. This is great for editing web layouts or assigned for frontend to editing in some cases.
however for aspcore project, I have to publish the project to be able to host on iis. The problem is that the cshtml files are all encrypted into ddl files.
This is not good for flexible editing of the project after publishing.
The question is, is there any way to host an aspcore project without publishing it?
or publish and still keep cshtml files?
Please discuss and give me advice.
My English is not good, I hope everyone does not mind.
thanks.
All-Star
53081 Points
23648 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 22, 2019 03:05 PM|mgebhard|LINK
No, the markup is compiled into a separate DLL.
Participant
970 Points
397 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 22, 2019 04:01 PM|lextm|LINK
In place editing (something popular before 2000) has been replaced by CI/CD in the past decades, which not only offers the same flexibility, but also enforces important rules like quality check.
Follow the trend, and don't go against it.
https://lextudio.com
---------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
All-Star
58234 Points
15673 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 22, 2019 07:08 PM|bruce (sqlwork.com)|LINK
just turn the feature on:
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.1
also you might look at git deployment publishing. in this model, the site is published from the source.
Contributor
4963 Points
4209 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 22, 2019 08:11 PM|DA924|LINK
I don't see why you cannot connect the VS Web project to local IIS and run the project code on local IIS, just like you can do it using IIS Express. I bet the cshtml files are not encrypted in the VS project. It's not about debugging. It is the ability to run the Web project on local IIS without having to publish the project to IIS.
https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017
Member
5 Points
48 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 03:55 AM|sonht10|LINK
hi bruce,
thank you your reply.
I tried your way but the cshtml file is still compiled into the dll. Still nothing has changed.
Install the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package.
https://imgur.com/a/qPOUwEh#xOQxahm
Am I missing anything?
Member
5 Points
48 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 04:02 AM|sonht10|LINK
hi lextm, da924,
thank your reply,
Imagine, you are publishing the website to your customers.
After a while, your customers need to revise the web interface (just a bit). But the source code for this project was lost for some reason.
If the host has cshtml files, your frontend can edit these files without the entire project source code.
do you have any ideas?
Contributor
4963 Points
4209 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 04:37 AM|DA924|LINK
Why are you trying to publish the project only to turn around to do something with the HTML that is in a DLL? Just push the Web project out off of the Web project's properties to local IIS using VS. That way, the HTML in the cshtml files are still in string format and you can manipulate them while in development mode.
I am sure you manipulated the cshtml files in the project while it was configured to use IIS Express in Visual Stuido.
Contributor
2690 Points
874 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 08:42 AM|Rena Ni|LINK
Hi sonht10,
If you want the frontend could edit .cshtml file,you could create a child site in your main site about these files and update the child site by using command line.
For hosting on IIS without compiling to .dll file, As mgebhard said,It is impossible.
Best regards,
Rena
All-Star
53081 Points
23648 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 11:03 AM|mgebhard|LINK
You expect to lose your customer's source code? The solution is pretty simple... target a framework that has the features you want.
All-Star
58234 Points
15673 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 23, 2019 03:45 PM|bruce (sqlwork.com)|LINK
this really goes against the asp.net core model. the old asp.net framework with its AspNet_Compiler was designed this way (all source files on server and compiled at run time). If this design is you desire, you should pick a different framework rather than asp.net core. Try node.js, python, ruby or php.
Member
5 Points
48 Posts
Re: how to hosting the complete source code on iis with aspcore 3.0?
Dec 25, 2019 03:02 AM|sonht10|LINK
Thank for all,