Creating an ASP.NET Web Application in a physical folder of your choice

Creating an ASP.NET Web Application in a physical folder of your choice

When you create a new ASP.NET Web Application, VS.NET by default creates a folder with the specified application name under the Visual Studio Projects folder (typically under :Documents and SettingsMy DocumentsVisual Studio Projects), and a folder with the same name under :Inetpubwwwroot. In the first folder it creates just the solution files (.sln and .suo), while all the ASP.NET project’s source files (.aspx, .vb, .config etc.) go into the second folder.

However, you usually want to keep all your projects under a common folder, and have the source files together with the solution files (so that’s easier to move everything to another computer, for example), whether they are Windows or Web application, and thus don’t like VS.NET’s default behavior. It would be preferable to have the possibility to specify a virtual and a physical folder when you create the web application, but unfortunately this is not possible from the New Project dialog window.

The solution is easier than what you may think, though. Say that you want to create a web application named MyWebTest, and that you want to place all the source files (not just the solution files) under c:My ProjectsMyTestWeb. Here are the steps to follow:

  1. Create a Blank Solution in c:My ProjectsMyTestWeb, so that the solution files will be placed in a new folder with this name and in this location.
  2. From the IIS administration console create a new virtual directory named MyTestWeb that points to the physical folder created above. (Alternatively, you can create the virtual folder from Windows Explorer, through the Web Sharing page of the Properties dialog for the physical directory.)
  3. Add a new project of type ASP.NET Web Application to the blank solution, and in VS.NET’s New Project dialog use MyWebTest as project name. VS.NET recognizes that a virtual folder with that name is already present, and use it for the project, even if it points to a physical location that is different to that VS.NET would have used by default.
Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes