Created folder in VS2012 is missing on the server - asp.net

I have very strange problem and I don't even know why it occurs. Maybe I'm doing something wrong.
So i have created new website in VB2012. Then i've created new folder and uploaded everything on my host. But this folder is missing on the server. Why is that and how to fix it? Do i need to create desired folders on my host manually?
Folder named "photos" added in my website project
Folder is missing on the server when I upload that project

Empty directories are not published when using Visual Studio.
The top answer to this question regarding a similar issue suggests a workaround:
You need to create a placeholder.txt file in each empty directory if you want the precompilation tool to generate these empty folders. Failing that you can create a command line app that will create the folders in your post build events (but only if you are using web application project not web site project).

From my experience VS won't publish an empty folder. As a workaround we always put a dummy file in the folder to ensure that it gets copied over. Something like "placeholder.txt"

Related

PDF is not accessible through URL in IIS .NET Framework 4.8 app

I have a PDF file in a folder on a server within a IIS website app that I need to be able to open through a link/url, like below:
https://api.example.com/my-path/my-pdf-file.pdf
The PDF file is hosted in a folder of my IIS application. When I try to access it through the link, I've got a 500 server error.
I tried several things within IIS settings (URL Rules, web.config, mime-types), but nothing worked so far.
Any advice will be much appreciated.
Is the folder included in the project? You can't just add a folder outside of Visual Studio, but have to use VS to add that folder.
You can right click on that existing folder (which of course is a sub folder of your project) and check this setting:
So, in my case, I right click on UpLoadFiles.
If the folder ALREADY is included in the project, then you get a option to EXCLUDE the folder like this:
However, if the folder is not included, then you see this:
so, is that folder included in your project? You want to check above.

How to handle path on azure for XmlDocumentationProvider

I am using azure for deployment of my new Web API's, I am new with deployment on IIS and azure.
I have added my Web API's on azure as web application, and it's working fine, till I added documentation for each API's functions. After adding description I uncomment line below from HelpPageConfig.cs.
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
It's working finr locally, and I am able to see all descriptions, but when I published it on azure, I am getting error saying,
Could not find a part of the path 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
site url : http://mejodo.azurewebsites.net/
Do I need to change path ?
File is already created in my system on D:\home\site\wwwroot\App_Data directory.
What changes I need to do to make it work ?
I had the same issue. For me the file was generated. Please follow the below steps.
Click on show all files in solution explorer.
Check whether you have a file in App_Data folder
If you have the file, right click and include the same in your project.
Now build and publish to Azure.
I hope this will work. Thanks
In my case XmlDocument.xml had to be added in Visual Studio to the App_Data folder within the solution using 'add existing item'.
Just add to your project new folder "App_Data" with XmlDocument.xml and publish
When you say that you have Web API's on azure as web application, do you mean that they are applications under the site ? If yes, then I think you are missing the application name in the path to the XML file.
Try going to mejodo.scm.azurewebsites.net > debug console > powershell to see the exact folder structure....
You must verify that the line in the HelpPageConfig.cs file in the Area>HelpPage>App_Start folder.
that is in the register method, this line is
config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
this uncommented
then you must verify that in the project configuration, in the build XML documentation file, this is the same path as the above mentioned line.
When you publish the xml file goes in the bin folder, so change 'D:\home\site\wwwroot\App_Data\XmlDocument.xml'.
to
'D:\home\site\wwwroot\bin\XmlDocument.xml'.
and it should work.

How to get ASP.NET website precompilation to exclude a certain folder

The several different environments (e.g. live, demo etc) of my web app are differentiated by config settings in a folder called EnvironmentConfiguration. Whenever I update one of the sites, I delete the EnvironmentConfiguration folder from the precompiled site before copying the website files over (i.e. in order that the EnvironmentConfiguration folder in the deployment location is not replaced).
Just to save mistakes, is there a way I can get Visual Studio not to produce the EnvironmentConfiguration folder when it precompiles the site for me?
You could try a couple of things.
1) Right click on the folder in the solution and select exclude from Project.
2) Look at each of the files in the folder and set the BuildAction property to 'None' rather than 'Content'

way to excluding static folders like Images in publish website feature in Visual Studio 2010

In my website when deploying production most of the time I only need to deploy bin folder and just marker files if new pages added.Since my website contains gigabytes of images folder and static stuff not updates frequently, it takes ages to complete a one publish cycle in visual studio website publish feature is there workaround to overcome like excluding these static folders when website publishing
Thanks...
You could use the Web Site Copy Tool - deploying a web site using this tool only updates the files that have been changed.
After you connect to the remote site, each file will have one of the following statuses.
Unchanged
The file has not changed since the last time the file was copied.
Changed
The file has a timestamp that is newer than the timestamp taken when the file was last copied. If the same file has been changed in both the source site and the remote site and you synchronize these files, the tool prompts you to indicate in which direction you want to copy.
New
The file has been added since the last time the site was copied.
Deleted
The file has been removed since the last time the site was copied. These files are shown only if you select Show Deleted Files. If you synchronize a file that has been deleted in one site, the tool will prompt you to indicate if you want to delete the file from the other site.
See this article for further information
I don't know if there is another way. But if you make the folder hidden in the file system, then it would not be published.

How to create a solution file using vs 2008

I have all the files for the deployment listed below :
-BIN
-CSS
-IMAGES
default.aspx
PrecompiledApp.xml
Web.xml
The above files can be copy pasted in the webapps folder and default.aspx could be run from the browser.
i want to create a solution sln file from this. How to create a solution file?
A solution is merely a container of projects. If you create a project containing these files, the solution file will be created automatically in the same directory (unless you specify otherwise).
File -> New Project
Expand Other Project Types, Select
Visual Studio Solutions
Under Templates, ensure you have
selected Blank Solution
Enter a name and a location for the
solution and click OK
File -> Add -> Existing Web Site
Select the folder that contains your
website and click Open
It looks as though you are creating a web site. I've never been able to create a solution with just a website in it (a web application is a different beast however). However, I have found a workaround, although it's a little cludgy. Create a new class library project (any project type will do really). This will create the project file. Then File -> Add -> Exisiting Web Site. Point to your existing web site and add it. This will create the solution file as you now have two items. You can now delete the first project that you created. This will leave you with a solution file with one web site in it.

Resources