Over a million developers have joined DZone.

Quick Tip – Including Empty Directory While Deploying a Web Application

·

During this week I had to deploy an ASP.NET MVC 3 web application to a host environment using web deploy. The problem I faced was the deployment of an empty directory which is being used by the application. By design, when using web deploy tool in Visual Studio it skips empty directories when packaging a web application.
So How can you deploy this empty directory and overcome this problem?
The solution is to put an empty stub file in the directory you want to deploy.
Just create an empty text file in the directory and Visual Studio will deploy the directory.

Just to share a thought - This solution is a workaround to a Visual Studio problem which IMHO need to be solved. If a developer is adding an empty directory, VS need to give him/her the ability to choose whether to deploy it or not and not to omit the directory from the deployment package.
Topics:

Published at DZone with permission of Gil Fink, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}