问题
I Have Build project with visual studio but when i want to publish my website i get an empty folder and nothing there ! no error or warning ,
Building directory '/project/Users/'.
Pre-compilation Complete
------ Publish started: Project: F:\...\project\, Configuration: Debug Any CPU ------
Connecting to site E:\project...
Publishing directory /...
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
e:\project is empty
回答1:
Build your project (not rebuild) it will work :)
OR
Other workaround is publish in debug mode first then change settings and publish in release mode. it will surely work :)
回答2:
Try building the project in release mode first then publish.
回答3:
In my case there was a little item in the .csproj file that I had to remove. I had to unload the project, edit the .csproj, then hunt down and remove the following XML tag:
<Target Name="GatherAllFilesToPublish">
</Target>
Once I republished, all was well.
回答4:
Creating a new profile helps solved my problem.
How to: Deploy a Web Project Using One-Click Publish in Visual Studio
回答5:
In visual studio 2013
there is a bug that will produce empty folder when you publish only if you are using existing publish profile/settings. The existing profile setting may have come from code you checkout or got from another source. The solution
is to create your own publish profile from scratch and make a new folder for it.

Start wizard from beginning.

回答6:
Try checking the Properties
> Build Action
of your files if it was set to None
. If it is, it will not copy your files, just the folders. On my project, it was set to
Build Action = Content
回答7:
I'm having this issue with vs2015 update 3. I had changed my build folder (due to paths too long error), and i can see the last steps in the publish output:
Copying all files to temporary location below for package/publish:
3>D:\DEPLOYED_SITES\BUILD_TEMP\Package\PackageTmp
So i can at least get to the files in the PackageTmp folder. I could create a post build event which can copy the build files to the correct output folder.
回答8:
In my case I had checked on "Include IIS settings as configured in IIS express" in the project properties << Package/Publish Web *" section. Once I unchecked this option the publish worked as expected.
回答9:
Recreate publish profile this should resolve
来源:https://stackoverflow.com/questions/13073284/publish-website-getting-empty-folder