I have an ASP.Net project created by a team member on another computer. The project references a virtual directory that exists on my computer but under a different localhost location.
Currently, the following error occurs when I try to open the project:
The local IIS URL
http://localhost/foo/default.aspx
specified for Web project foobar has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create the virtual directory now?
[Yes] [No]
So, there are two options:
Where is the virtual directory location (in my case http://localhost/foo/default.aspx
) specified within the project? Can I change this manually, say in a configuration file within the project, either before or after I open it? A configuration change seems more ideal than manually opening IIS to override a virtual directory path.
EDIT (solution): Buried in the comments below is the following answer (Thanks @Thyamine)
This can be configured in the foo.csproj file for the project.
Look for the lines:
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{F00-000-000}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<!-- ... -->
<IISUrl>http://localhost/Foo/default.aspx</IISUrl> <!-- EDIT THIS LINE -->
<!-- ... -->
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
To run the application without opening Visual Studio, You need to install IIS (as rtpHarry has suggested). Then You need to have your application in a virtual directory. To create virtual directory perform following steps: Type inetmgr at command prompt -> Click OK.
Right-click on your ASP.NET MVC5 application inside Visual Studio and then click "Publish". Now, select the "IIS" option from the left menu and click "Create Profile" button. Change your publish method to "Web Deploy Package" and provide your package location, then click "Next". Click "Save" on the next screen.
In Visual Studio, on the File menu, click New and then click Web Site. In the New Web Site dialog box, click Browse. In the Choose Location dialog box, click the Local IIS icon. You must be a member of the Administrators group on the local computer to access the IIS metabase and create a virtual directory.
You could allow it to create the directory, then re-map it in IIS Manager to point to the directory you would prefer it to use.
Or you could tell it not to map at all, and then manually create the virtual directory with IIS Manager to the directory you already have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With