22

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

Moslem7026
  • 3,290
  • 6
  • 40
  • 51

10 Answers10

27

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 :)

  • You also have to make sure that your deployment path ends with a ` \ `. Otherwise the deployment folder will be empty. – krizzzn Jan 25 '17 at 13:23
10

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.

David Morton
  • 16,338
  • 3
  • 63
  • 73
7

Try building the project in release mode first then publish.

  • 1
    I changed the configuration from Release - Any CPU to Release - X86 and it worked. Changed it back to Release - Any CPU and it now works as expected – Amanda Jul 19 '16 at 02:51
4

Creating a new profile helps solved my problem.

How to: Deploy a Web Project Using One-Click Publish in Visual Studio

smshahiran
  • 193
  • 1
  • 3
  • 13
2

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.

enter image description here

Start wizard from beginning.

enter image description here

PUG
  • 4,301
  • 13
  • 73
  • 115
0

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

Jude Duran
  • 2,195
  • 2
  • 25
  • 41
0

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.

Community
  • 1
  • 1
James
  • 557
  • 7
  • 16
0

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.

Dowlers
  • 1,434
  • 16
  • 26
0

Recreate publish profile this should resolve

0

for me, I

  1. created a new publish profile
  2. Rebuilt the site
  3. Published the site
Kwami
  • 41
  • 2