Domanda

In visual studio 2010, when publishing a website, it seems that empty folders are not being published.

I am quite sure that this behavior were introduced in vs2010. I cant find it documented anywhere, not sure if I should call it a feature or a bug... Anyway, is it possible to revert to the old behavior as I wish to keep my folder structure on the production server.

Altri suggerimenti

There was a bug report to Microsoft about this and they said that they would not fix it. http://connect.microsoft.com/VisualStudio/feedback/details/546356/publish-deploy-does-not-deploy-empty-folders

Too bad. Because it used to work in Visual Studio 2008.

Add a dummy file like dummy.txt to the directory and then the directory will be created. Note that it is not necessary to actually deploy the dummy file. It only needs to exist as part of the project in the build environment.

The Empty folder doesn't have any memory value so if you want to add your folder's into your published folder then simply add any item(e.g. text File) into it and set the "Copy to output directory" = Copy always or Copy if Newer this will resolve you problem

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top