Assuming you do not have Visual Studio 2010 installed on your hudson server, then it may be that you are missing the publishing "targets" file. After a lot of head-to-desk banging, I finally solved this.
For quite a while I have known that I needed to copy the directory
C:Program Files (x86)MSBuildMicrosoftVisualStudiov10.0WebApplications
from my local machine with VS2010 to my server in order to get the project to build. But to get the project to also publish I needed to also copy over the directory
C:Program Files (x86)MSBuildMicrosoftVisualStudiov10.0Web
Note: In my case I am actually committing those folders to my source control and changing the <MSBuildExtensionsPath32>
value in my csproj file to point to these checked out folders (so there is one less step when prepping a server). This isn't necessary to get it to work, but you may want to consider this after you solve your issue.
UPDATE: So after I did the above, the build complained that it could not find "Microsoft.Web.Deployment.dll". To solve this I needed to install Microsoft Web Deploy v2.0 on the server even though I am only publishing to the file system. I guess I can see the logic in this.
UPDATE: I have discovered that installing "Visual Studio 2010 Shell (Integrated)" through the IIS Web Platform Installer will install the required build targets. This seems like a nice compromise between not having the entire Visual Studio application installed on your server and not manually copying seemingly arbitrary folders to your server from your dev machine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…