DCSIMG
Quick Tip – Including Empty Directory While Deploying a Web Application - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2013 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

Quick Tip – Including Empty Directory While Deploying a Web Application

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.

Comments

שלמה גולדברג (הרב דוטנט) said:

גיל התלונן ובצדק שכשעושים Deploy ל - WebApplication זה לא מכיל את התיקיות הריקות, והוא הציע להוסיף קובץ

# May 29, 2011 12:02 PM