I have an ASP.NET project which uses IIS. IIS site is configured to use custom binding host name. Project file contains following settings:
...
Opening as an Administrator didn't fix the problem for me. What fixed it for me was opening both the .csproj
and .csproj.user
files and ensuring that both had UseIISExpress
set to false
.
In my case, the .csproj.user
file was overriding the .csproj
file even though SaveServerSettingsInUserFile
was marked false
.
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseIISExpress>false</UseIISExpress>
<!-- ... -->
</Project>
when you use enable the use for IISexpress, the applicationHost.Config (located in %userprofile%\iisexpress\config), you have to check the option "Apply Server settings to all users (store in project file)" to avoid your settings written in yourProject.csproj.user
doing this is the same as editing your project.csproj file and writing
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>62242</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:8100/Claims/</IISUrl>
<OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>
<IISAppRootUrl>http://localhost:8100/Claims/</IISAppRootUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl></CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
If you enable IISExpress and your applicationHost.config file doesn't contain the entry related to your project settings, you just have to push the button "Create Virtual Directory" and done!
hope this helps
I landed here when a project, configured to use IIS, wouldn't load because it couldn't find the web site (myproject.mycompany.local)--even though the web site loaded fine in my web browser.
The solution was to make sure the site's binding in IIS 7 had the host name set to "myproject.mycompany.local". To get to your site's bindings:
If you site doesn't load in the web browser either, it's probably because you don't have an entry for it in your hosts file:
127.0.0.1 myproject.mycompany.local
I had the same issue, running as administrator didn't work for me.
Setting <UseIIS>True</UseIIS>
to false in project's ".csproj" file temporarily could load the project, but value was returning to True after restarting or closing the solution.
Completing @Cyrus 's answer (that worked for me) for a more neat answer, I focused more on project's csproj.user file and found the exact source of problem: setting <UseIISExpress>true</UseIISExpress>
to false, then reloaded the project. working good, without deleting csproj.user file. result is like this:
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<UseIISExpress>false</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<NameOfLastUsedPublishProfile>My Project's Name</NameOfLastUsedPublishProfile>
</PropertyGroup>
I have set "SaveServerSettingsInUserFile" as True and it worked for me.
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>50584</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:50584/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>True</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
Source : click here
I had the same issue, for me all i had to do was open visual studio as an administrator and this resolved the issue for me.
so simple right click on the visual studio 2012 and click "run as administrator". hope this helps