Here is how the deployed content looks like after publishing (on Azure Website):
以下是发布后(在Azure网站上)部署内容的样子:
/approot/packages - NuGet packages
/approot/src - all the source files from the solution
/approot/global.json - a list of global NuGet packages
/wwwroot/bin/AspNet.Loader.dll - the only .dll file in wwwroot folder
/wwwroot/css - front-end code
/wwwroot/lib - front-end code
/wwwroot/web.config - auto-generated
web.config generated during publishing
发布期间生成的web.config
I'm wondering, how to make it deploy only the compiled output and not the source files?
我想知道,如何使它只部署编译输出而不是源文件?
1 个解决方案
#1
9
-
If you are publishing through VS 2015, then make the following selection to not deploy the source files:
如果要通过VS 2015发布,请进行以下选择以不部署源文件:
-
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)如果您不使用VS,那么您可以使用kpm pack命令来实现此目的。例如,以下是VS用于创建要部署的程序包的命令(您可以在工具|选项|项目和解决方案|构建和运行中启用详细日志记录,以查看此内容)
"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
“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 --conflease 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:
一些信息:上面的效果是现在您的应用程序已预编译,您应该在packages文件夹下看到一个包,web.config中的kre-app-base标志指向此包。例:
<?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>
#1
9
-
If you are publishing through VS 2015, then make the following selection to not deploy the source files:
如果要通过VS 2015发布,请进行以下选择以不部署源文件:
-
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)如果您不使用VS,那么您可以使用kpm pack命令来实现此目的。例如,以下是VS用于创建要部署的程序包的命令(您可以在工具|选项|项目和解决方案|构建和运行中启用详细日志记录,以查看此内容)
"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
“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 --conflease 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:
一些信息:上面的效果是现在您的应用程序已预编译,您应该在packages文件夹下看到一个包,web.config中的kre-app-base标志指向此包。例:
<?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>