Publish Website Getting Empty Folder
Asked Answered
B

11

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

Bugaboo answered 25/10, 2012 at 16:41 Comment(2)
Are you publishing locally or onto a remote server?Sculpturesque
Take a look at this post, it may help: #12201646Sculpturesque
R
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 :)

Renaissance answered 18/9, 2013 at 6:52 Comment(1)
You also have to make sure that your deployment path ends with a ` \ `. Otherwise the deployment folder will be empty.Estoppel
F
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.

Floristic answered 6/10, 2016 at 17:59 Comment(1)
For whatever reason I had (2) of these elements in my .csproj file - removed them both.Conker
H
7

Try building the project in release mode first then publish.

Hijacker answered 20/3, 2013 at 11:28 Comment(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 expectedPitchman
V
4

Creating a new profile helps solved my problem.

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

Varicolored answered 15/7, 2016 at 9:37 Comment(0)
H
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

Halfblooded answered 3/11, 2014 at 20:0 Comment(1)
Created a new publish profile and it worked.Consort
D
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

Defelice answered 28/5, 2013 at 3:22 Comment(0)
R
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.

Reflux answered 31/7, 2016 at 11:25 Comment(1)
Did you found any solution?I have the same issue and nothing from the above resolved it.Kadiyevka
S
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.

Stutter answered 3/12, 2018 at 20:34 Comment(0)
K
0

Recreate publish profile this should resolve

Kaiulani answered 24/4, 2019 at 13:17 Comment(0)
A
0

for me, I

  1. created a new publish profile
  2. Rebuilt the site
  3. Published the site
Apologue answered 10/4, 2023 at 4:4 Comment(0)
I
0

This happened to me because of a line in a root Directory.Build.props file:

<IsPublishable>false</IsPublishable>

This made all projects non-publishable by default (e.g., libraries and unit tests), and projects that needed to be published had to explicitly set <IsPublishable>true</IsPublishable> in their .csproj file (e.g., .EXEs).

Unfortunately, when publishing a Blazor web assembly project with IsPublishable=false, the publish step still does a whole bunch of work optimizing assemblies, etc., but it produces no output. There was no visual indication that the IsPublishable property was involved and overriding the important final step. After I tracked this property down and set it to true, then publishing the Blazor project did a lot more work and actually produced output.

Invalid answered 3/9, 2023 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.