VS 2010 预编译网站与构建过程?
VS 2010;贸易融资2010; ASP.NET 4.0; 2010 年 Web 部署项目;
我正在使用构建过程模板来进行一键部署(仅适用于开发和质量检查)。我希望预编译我的网站。我可以使用命令行来完成
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler
-v /site_name
-p "C:\...\site_name"
-f "C:\...\site_name1"
此操作,使用: 如果我将文件从 site_name1 复制到 site_name,则效果很好...
但是 IDE 中有一个选项吗?? 看起来确实如此必须从命令行执行此操作是愚蠢的。我读过很多关于不同选项的内容,但似乎没有一个适用于使用构建定义进行构建。
VS 2010; TFS 2010; ASP.Net 4.0; Web Deployment Projects 2010;
I am using the build process templates in order to do one-click deploys (for dev and QA only). I want my sites to be pre-compiled. I can do it with the command line, using:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler
-v /site_name
-p "C:\...\site_name"
-f "C:\...\site_name1"
and this works fine if I copy the files over from site_name1 to site_name...
but is there an option in the IDE for this?? It seems really silly to have to do this from the command line. I've read a lot about different options, but none seem applicable to building with the build definitions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以通过将以下内容添加到
.csproj
文件中然后在 TFS2010 的默认模板中
/target="PrecompileWeb"
You can do this by adding the following to your
.csproj
fileThen in TFS2010's default template
/target="PrecompileWeb"
就目前情况而言,我找不到任何 IDE 选项来使用构建过程模板预编译网站。我希望被证明是错误的,因为使用命令行 aspnet_compiler 需要我们(在我们的设置中)破解实际的构建过程模板,这是我们试图避免的。
我很想被证明是错的! :)
As it currently stands, I can not find any IDE option to pre-compile websites using the build process templates. I would love to be proved wrong, as using the command line aspnet_compiler requires us (in our setup) to crack open the actual build process template, which we are trying to avoid.
I would love to be proved wrong! :)
我们有一个网站作为 Web 应用程序存储在 TFS2010 中。我使用 MSBuild 命令从 TFS2010 进行部署。如果您在 VS2010 Team Explorer 中打开项目,您将看到有一个“构建”选项。如果添加构建并在“进程”选项卡中使用构建参数,例如 ...:/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=RemoteAgent /p:MSDeployServiceUrl =http://111.111.111.111/msdeployagentservice /p:DeployIisAppPath=MySiteNameInIIS /p:UserName=myDomain\BuildUser /p:Password=BuildUserPassword 在“进程”选项卡中显示“要构建的项目”的地方,您只需将其指向您的 .sln 文件(可能与 .cspro 一起使用,但语法略有变化)
我们有一台 TFS2010 服务器,我将一些站点部署到开发、质量保证、预生产或生产 IIS 服务器。我对开发版本进行单元测试,如果测试失败,那么我不会部署。
MSBuild 命令进行预编译,这对您有用吗?
We have a website that is stored in TFS2010 as a Web application. I use a MSBuild command to deploy from TFS2010. If you open your project in VS2010 Team Explorer you will see there is a "Builds" option. If you add a build and in the process tab use a build argument like ...:/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=RemoteAgent /p:MSDeployServiceUrl=http://111.111.111.111/msdeployagentservice /p:DeployIisAppPath=MySiteNameInIIS /p:UserName=myDomain\BuildUser /p:Password=BuildUserPassword In the Process tab where it says "Items to Build" you just point it to your .sln file (might work with a .cspro but then the syntax changes slightly)
We have a TFS2010 server and I deploy a few of our sites to a dev, qa, pre-production or production IIS server. I do unit testing on the dev build and if the test fail then I do not deploy.
The MSBuild command does the pre-compile, would that work for you?
添加了预编译设置。以下工作在 Visual Studio 2015 中
A setting for precompiling has been added. The following works in Visual Studio 2015