How to disable source code publishing in ASP.NET 5 apps?
If you are publishing through VS 2015, then make the following selection to not deploy the source files:
If you are not using VS, then you can use
kpm pack
command to achieve this. For example, following is the command that VS uses to create the package to deploy (You can enableDetailed
logging in Tools | Options | Projects and Solutions | Build and Run, to see this)"C:\Users\kiranchalla\.kre\packages\kre-clr-x86.1.0.0-beta2-10690\bin\kpm.cmd" pack --runtime KRE-CLR-x86.1.0.0-beta2-10690 --out "C:\Users\kiranchalla\AppData\Local\Temp\AspNetPublish\WebApplication5-91" --wwwroot-out wwwroot --no-source --configuration Release --quiet
Some info:
The effect of the above is that now your application is pre-compiled and you should see a package under the packages folder and the kre-app-base
flag in web.config points to this package. Example:
<?xml version="1.0" encoding="utf-8"?><configuration> <appSettings> <add key="kpm-package-path" value="..\approot\packages" /> <add key="bootstrapper-version" value="1.0.0-beta1" /> <add key="kre-package-path" value="..\approot\packages" /> <add key="kre-version" value="1.0.0-beta2-10690" /> <add key="kre-clr" value="CLR" /> <add key="kre-app-base" value="..\approot\packages\WebApplication5\1.0.0\root" /> </appSettings></configuration>