<p>I am trying to publish an Asp.net MVC web application locally using the NAnt and MSBuild. This is what I am using for my NAnt target;</p>

<pre><code>&lt;target name="publish-artifacts-to-build"&gt;
    &lt;msbuild project="my-solution.sln" target="Publish"&gt;
      &lt;property name="Configuration" value="debug" /&gt;
      &lt;property name="OutDir" value="builds\" /&gt;
      &lt;arg line="/m:2 /tv:3.5" /&gt;
    &lt;/msbuild&gt;
&lt;/target&gt;
</code></pre>

<p>and all I get is this as a response;</p>

<pre><code>[msbuild]          Skipping unpublishable project.
</code></pre>

<p>Is it possible to publish web applications via the command line in this way?</p>

[{'answer_id': 48553, 'author': 'Espo', 'author_id': 2257, 'author_profile': 'https://Stackoverflow.com/users/2257', 'pm_score': 5, 'selected': True, 'text': '<p>The "Publish" target you are trying to invoke is for "OneClick" deployment, not for publishing a website...  This is why you are getting the seemingly bizarre message. \nYou would want to use the AspNetCompiler task, rather than the MSBuild task.  See <a href="http://msdn2.microsoft.com/en-us/library/ms164291.aspx" rel="noreferrer">http://msdn2.microsoft.com/en-us/library/ms164291.aspx</a> for more info on this task.  Your "PublishDir" would correspond to the TargetPath property of the task. </p>\n\n<p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1032073&amp;SiteID=1" rel="noreferrer">Source</a></p>\n'}, {'answer_id': 6762142, 'author': 'Alexander Beletsky', 'author_id': 386751, 'author_profile': 'https://Stackoverflow.com/users/386751', 'pm_score': 4, 'selected': False, 'text': '<p>I came up with such solution, works great for me:</p>\n\n<pre><code>msbuild /t:ResolveReferences;_WPPCopyWebApplication /p:BuildingProject=true;OutDir=C:\\Temp\\buidl\\ Test.csproj\n</code></pre>\n\n<p>Secret sauce is _WPPCopyWebApplication target.</p>\n'}]
['https://Stackoverflow.com/questions/48550', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4642/']