I am using visual studio 2010. I have a website project that I would like to build a website deployment package every time I build a the project. Basically I am looking for some example of a post build MSBuild command that will basically do the same thing as the "Build Deployment Package" option from the right click menu of the website.
相关问题
- Visual Studio 2019 - error MSB8020: The build tool
- Visual Studio 2010 randomly says the command line
- (ASP.NET) Project file must include 'WindowsBa
- Partial Form Class C# - Only display code view for
- Why does this code not compile?
相关文章
- How to show location of errors, references to memb
- Log4Net Multiple Projects
- Compiling error in C++ project with C and C++ code
- How to use Mercurial from Visual Studio 2010?
- Build errors of missing packages in Visual Studio
- VSIX: execute code on VS startup
- Copy different file to output directory for releas
- How do we alias a Sql Server instance name used in
I assume you are using Web Application Projects, because Web Site projects do not have the "Build Deployment Package".
I would recommend not performing a package on every build, because it will slow down your development drastically. With that being said, you can do it here is how.
If you really wanted to do this your best bet is not to use post-build event, but to edit the project file and extend the build process. To do this open the .csproj file for your web and then towards the bottom (after the Import elements) place the following
What this does is extend the build process to call the Package target. This is the same target that is called when you invoke the "Build Deployment Package" target in Visual Studio.
For me, Sayed's answer didn't work with a command-line msbuild execution (I needed the
Publish
target, but the idea is the same):I couldn't use
DefaultTargets
because I wanted to publish on the command-line but only build from VS. Here's what did work: