Closed binn closed 6 years ago
This is the main difference with Peachpie - PHP source files are not treated as static files. .php
files are source files as .cs
files are. They are compiled and the server actually runs the compiled .dll
.
If you have created a project file (https://www.peachpie.io/getstarted) simply run dotnet run
and all files are compiled for you. You can trigger re-compilation when source files change by using dotnet-watch tool (https://github.com/aspnet/Docs/blob/master/aspnetcore/tutorials/dotnet-watch.md).
Ah, @jakubmisek I was looking for something more like "throw in static file, get it on web-server, no compilation needed." type thing, so I wouldn't have to recompile my .NET core project every time I want to do some testing. Does anything similar exist, or is it possible to have some kind of reverse proxy to do this?
Do you recompile your C# project every time you change its source code?
Yes I do.
My development process goes something like
dotnet run
dotnet restore
//make changes
dotnet publish
//copy files to server
dotnet output.dll
//via cron job or something
I want to have a way to just make a "small file" throw it in my wwwroot directory, to do some serverside code, such as uploading test.php
to wwwroot/tests/
and then just browse and view my tests. No need to recompile, no need to restart my webserver.
can you just throw a .cs
file somewhere and run it without compilation? the same
Is that really possible? Let me have a look.
no
Yeah, that's what I'm looking to do. For example with IIS or Apache I can just throw in a php file in my public directory and it'll run on call. Is there any way to do this with ASP.NET Core, or is this the only way?
I would suggest to start on https://docs.microsoft.com/en-us/aspnet/core/
What I mean by this is, ASP.NET Core creates a folder named
wwwroot
and that's where the server's static files.Can I store PHP files in there, and per request they just "work," like many webservers do. If not, can I somehow add compatibility to this, or is there any alternatives that support this?