Directory does not exist. Parameter name: directoryVirtualPath

This post is similar to Directory does not exist. Parameter name: directoryVirtualPath

The answer helped me debug. Apparently, there are missing folders on the target server. My application worked fine locally, but when I published, several script sub-directories did not get published. When I manually FTP'd them up, the app worked fine!


it seems that this error originates from "not including desired files in your application's directory" or uploading your code in a directory that is not configured as virtual directory , or even in incorrect directory.


To expand on the information here.

I often bundle all file in a folder like so: "~/Content/js/angular/modules/*.js", And this works great as long as the folder exists.

The issue is, if that folder is empty when you publish it will not be published and will result in the above exception. So now i either put an empty.txt or something of the sort of add the folder manually if i want them to remain empty for now.