I have attempted to get IIS Express working so that external users can view my MVC ASP.NET development website. I followed instructions on this SO answer but am now getting a 503 error when accessing the website using my external IP address, localhost still works fine.
My configuration file seems ok
<site name="ManagerUI" id="5">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Application Development\Manager\MAIN-Branch\ManagerUI\ManagerUI" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:1904:" />
</bindings>
</site>
I found the following SO answer which solves the issue, but it will ONLY allow it to work on an external address rather than all my IP addresses (localhost, external one etc)
<binding protocol="http" bindingInformation=":1904:your-machine-name" />
I managed to solve it, my mistake was thinking that you could only have one binding set, I then setup binding for every external address I wished to serve on and it now all works
<bindings>
<binding protocol="http" bindingInformation=":1904:" />
<binding protocol="http" bindingInformation=":1904:machineName" />
<binding protocol="http" bindingInformation=":1904:10.1.10.123" />
</bindings>
Related
I have a project on TFS, I have two solutions under two differents folders :
Project>.NET>projectwebhr
Project>.NETprojectwebfinance
When I try to load the first project it is loaded without errors.
At the same time, I want to load the second project by opening it in Visual Studio but I get the following error :
I already followed these steps but in vain.
When I check the config file, I find the following :
<sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
</site>
<site name="projectwebhr" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\XXX\projectwebhr\projectwebhr" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:2101:localhost" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="Clr4IntegratedAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
But cannot find the sitename for the second folder
You can try to add the site of the second folder to the <sites> node in the config file.
I ended up removing Sync from the IISExpress folder like below :
According to other SO questions the problem has been solved by editing the hosts file and applicationhost file. These two files are already properly setup on my machine. This error started ocurrring right after I upgraded to visual studio 2015 SP1
http://bdtest.localhost:50119/ returns bad request
Hosts File -
localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 bdtest.localhost
application hosts file
<site name="BizDox.Web" id="2">
<application path="/" applicationPool="Clr4ClassicAppPool">
<virtualDirectory path="/" physicalPath="C:\Source\BizDox\Summer2015-Navigation\BizDox.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:50119:*"/>
<binding protocol="http" bindingInformation="*:50119:localhost" />
<binding protocol="http" bindingInformation="*:50119:bdtest.localhost" />
<binding protocol="http" bindingInformation="*:50119:demo.localhost" />
<binding protocol="http" bindingInformation="*:50119:diy.localhost" />
<binding protocol="http" bindingInformation="*:50119:akuity.localhost" />
<binding protocol="http" bindingInformation="*:50119:owlsfactory.localhost" />
<binding protocol="http" bindingInformation="*:50119:rtp.localhost" />
<binding protocol="http" bindingInformation="*:50119:barebones.localhost" />
<binding protocol="http" bindingInformation="*:50119:sygnet.localhost" />
<binding protocol="http" bindingInformation="*:50119:firstsolution.localhost" />
</bindings>
</site>
What else could cause a 400 error if your host files are properly setup?
I am running VS2015 as admin.
VS 2015 changes the default applicationhost.config file located in mydocuments/iisexpress to be a project specific applicationhost.config file. You can find this in your web project under a hidden .vs folder.
Your two options are to either open this folder and edit the applicatoinhost.config file or to tell the .proj file to use the default config file located in documents/iisexpress. You simply have to alter/add this line to the .proj file.
<UseGlobalApplicationHostFile>true</UseGlobalApplicationHostFile>
Add this to the top of the file inside the <PropertyGroup> tag
Make sure to close VS and re-open it for changes to take effect. Also make sure to run as administrator.
Visual Studio uses IIS express
I want server to load data on start not on first http request.
Settings are located in [solutiondir].vs\config
If I paste those attributes and then run by F5:
serviceAutoStartEnabled="true" serviceAutoStartProvider="ApplicationPreload"
xml
<site name="DesignHubSite" id="4" serverAutoStart="true">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" serviceAutoStartEnabled="true" serviceAutoStartProvider="ApplicationPreload" physicalPath="C:\Users\user\Documents\GitHubVisualStudio\DesignHub\DesignHubSite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:54520:localhost" />
</bindings>
</site>
I get this error:
Error occurs "Process with Id of 6864 is not running"
The problem is that serviceAutoStartEnabled and serviceAutoStartProvider are attributes of the <application /> element not <virtualDirectory />.
You can verify this by running:
iisexpress.exe /config:[path_to_applicationhost.config] /siteid:[site_id_in_applicationhost.config]
You'll see an error similar to the following:
Filename: \\?\[path_to_applicationhost.config]
Line number: [line_number]
Error: Unrecognized attribute 'serviceAutoStartEnabled'
I found solution
in application pool i have set startMode="AlwaysRunning" for worker 'Clr4IntegratedAppPool'
other changes are not requiered
now it works as intended
I have two ASP.Net MVC applications, let's say Site1 and Site2.
For now, I can successfully access Site1 by visiting http://localhost/
Here's my IIS Express applicationhost.config file:
<sites>
<site name="Site1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_USER_HOME%\wwwroot\Site1" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:localhost" />
<binding protocol="http" bindingInformation=":80:10.49.0.137" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\logs\tracelogfiles" enabled="false" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="IISExpressAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
What I want now is:
Access Site1 on http://localhost/Site1
Place Site2 on %IIS_USER_HOME%\wwwroot\Site2
Access Site2 on http.//localhost/Site2
How should I change the above applicationhost.config to achieve what I want?
Thanks.
change your applicationhost.config as shown below and restart IIS Express.
<sites>
<site name="Site1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_USER_HOME%\wwwroot\" />
</application>
<application path="/site1">
<virtualDirectory path="/" physicalPath="%IIS_USER_HOME%\wwwroot\Site1" />
</application>
<application path="/site2">
<virtualDirectory path="/" physicalPath="%IIS_USER_HOME%\wwwroot\Site2" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:localhost" />
<binding protocol="http" bindingInformation=":80:10.49.0.137" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\logs" />
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\logs\tracelogfiles" enabled="false" maxLogFileSizeKB="1024" />
</siteDefaults>
<applicationDefaults applicationPool="IISExpressAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
Check this great entry.
Working with SSL at Development Time is easier with IISExpress - Scott Hanselman
Execute netsh command after applicationHost.config append binding.
netsh http add urlacl url=http://10.49.0.137:80/ user=everyone
I have an ASP.NET MVC site that contains a WCF SVC that is hosted on load balanced intranet site (2 servers). It is my understanding that for security reasons, our web server team does not allow anonymous authentication to our intranet web applications and the default is to use Windows authentication. I can access the SVC just fine on localhost, but when trying to access on the server I get the following error message:
System.NotSupportedException: Security
settings for this service require
Windows Authentication but it is not
enabled for the IIS application that
hosts this service.
I've found similar questions here on StackOverflow and the answers given didn't solve my specific issues. Here is my current web.config for the service areas...
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<client />
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_IClarityIntegration">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ClarityIntegrationBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ClarityIntegrationBehavior"
name="ClarityIntegration.MVC.Web.Services.ClarityIntegration">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IClarityIntegration"
contract="ClarityIntegration.MVC.Web.Services.IClarityIntegration">
</endpoint>
</service>
</services>
</system.serviceModel>
This issue was actually being caused by an exception within the WCF service itself. Not sure why it ended up responding this way, but after finding the exception and fixing it, this problem went away.