Blog from Saravanan Arumugam

Let us talk about Technologies

Folders created in solution not being deployed


I had some custom folders I created in my MVC3 application, such as Attachments, Forms etc. which I would use from code. For example, one of my web page would receive file attachments (Files being uploaded from the client side) from the user and store it in Attachments folder in the solution.

When I deployed my application, the these folders I didn’t show up on the Web Server.

Solution

Then I realized that the visual studio while deployment would not deploy any empty folder. Rather, it deploys files; if the file requires a new folder to be created it would create the folder.

So I created a simple text file in each of these custom folders, say AboutTheFolder.txt. This file ensured that the file gets created after creating the folders I was looking for.

Advertisements

2 responses to “Folders created in solution not being deployed

  1. corporations offshore October 19, 2012 at 8:14 pm

    When I created folder on windows with mkdir, I found some problem from folder nam so I write this function. <?php function filename_safe($name) { $except = array(‘\’, ‘/’, ‘:’, ‘*’, ‘?’, ‘”‘, ‘<‘, ‘>’, ‘|’); return str_replace($except, ”, $name); } ?> It can use with another functions about file system as file_put_contents to clean up file name.

  2. Vitaly Izmailova October 19, 2012 at 10:37 pm

    That’s really interesting. Thanks for posting all the great information! Had never thought of it all that way before.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: