after running appcmd set app "mywebsite/" /applicationPool:"Clr4ClassicAppPool" i attempted to re-run the web app only to find that IISExpress for the mywebsite app would no longer load in IISExpress.
I was able to fix the issue by locating the applicaitonhost.config file in C:\Users\myusername\Documents\IISExpress\config and updating the application pool and setting it to Clr4IntegratedAppPool.
Hope this helps someone out there that runs into the same issue.
<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="mywebsite" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Projects\mywebsite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:56103: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>
Related
I am trying to render my asp.net core app locally on https://localhost:44301 and also https://sub.localhost.test.
I added the following to my hosts file 127.0.0.1 sub.localhost.test. Then I edited the binding info in the C:/ProjectName/.vs/config/applicationhost.config file to the following
<site name="ProjectName" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\ProjectName" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44301:localhost" />
<binding protocol="https" bindingInformation="sub.localhost.test" />
</bindings>
</site>
I also trird <binding protocol="https" bindingInformation="*:44301:sub.localhost.test" />. But, when I go to https://sub.localhost.test I get Unable To Connect error.
Is it possible to run my local project on both https://localhost:44301 andhttps://sub.localhost.test`? If so, how?
Use port in the bindings. For http port 80 for https post 443
<binding protocol="https" bindingInformation="*:443:sub.localhost.test" />
</bindings>
Reference
I have a virtual directory set up in local IIS to serve up images but when the web page runs it gives a 404 for the images and shows that it is looking at the physical path for the website not the path specified for the virtual directory
I have things set like this:
IIS7.5
Site is MyWebSite
physical path is c:\mywebsite
virtual directory for MyWebSite\images has physical path c:\myimages
I can see everything including files in the virtual directory
Binding
http 127.0.0.1 port 80 (also tried port 59925)
host header is MyWebSite
Visual Studio
Properties>Web set to run in local IIS
project url is set to: http://localhost/mywebsite
Windows host file the last line is
127.0.0.1 localhost
I also tried
127.0.0.1 localhost/mywebsite
127.0.0.1 mywebsite
I run the site from visual studio and it runs fine except for the images. Clicking on the link in page source opens an error page with a 404 error. The physical path shown is c:mywebsite instead of c:\myimages.
I am assuming something is wrong with something in the setup above but not sure what it is.
Edit
the url in the page source is a relative one
img src=../../myimages/myimage.jpg
Requested URL http://localhost:80/mywebsite/mymages/image.jpg
Physical Path C:\MyWebSite\myimages\image.jpg
**Edit 2 ** here are the site bindings
<sites>
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<application path="/WebSiteManager2019" applicationPool="DefaultAppPool">
<virtualDirectory path="/" physicalPath="C:\MyWebSite" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:" />
</bindings>
</site>
<site name="MyWebSite" id="3" serverAutoStart="true">
<application path="/" applicationPool="MyWebSite">
<virtualDirectory path="/" physicalPath="C:\MyWebSite" />
<virtualDirectory path="/images" physicalPath="C:\MyImages" />
</application>
<bindings>
<binding protocol="http" bindingInformation="127.0.0.1:80:MyWebSite" />
</bindings>
</site>
<siteDefaults>
<logFile logFormat="W3C" directory="%SystemDrive%\inetpub\logs\LogFiles" />
<traceFailedRequestsLogging directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles" />
</siteDefaults>
<applicationDefaults applicationPool="DefaultAppPool" />
<virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>
With the latest version of visual studio, when I start debugging my app, I don't have access to all the URLs I've set up in my applicationhost.config file. These were working up to about a week ago.
I have this in my applicationhost.config bindings section:
<bindings>
<binding protocol="http" bindingInformation="*:51415:localhost" />
<binding protocol="http" bindingInformation="*:51415:subdomain.localhost" />
<binding protocol="http" bindingInformation="*:51415:othersubdomain.localhost" />
<binding protocol="http" bindingInformation="*:51415:thirdsubdomain.localhost" />
<binding protocol="http" bindingInformation="*:80:pro.myPC.mydomain.biz" />
<binding protocol="http" bindingInformation="*:443:pro.myPC.mydomain.biz" />
<binding protocol="https" bindingInformation="*:44303:pro.myPC.mydomain.biz" />
<binding protocol="https" bindingInformation="*:44303:localhost" />
</bindings>
I only see some of those listed in IISExpress:
http://subdomain.localhost:51415/
http://thirdsubdomain.localhost:51415/
https://pro.myPC.mydomain.biz:44303/
https://localhost:44370/
UPDATE:
I removed the bindings for the subdomains, and http://localhost:51415 still doesn't work. Only the https url remains in the IIS Express system tray tool.
For some reason, I need to start Visual Studio as an Administrator. I had set my shortcut to always start as Admin, but apparently after the update, the shortcut was reset.
Starting as admin, this works.
I modified the default application host file to enable remote connection to my IISExpress. As I learned here, I modified the bindings as follows:
<sites>
<site name="Development Web Site" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_BIN%\AppServer\empty_wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:80:*" />
</bindings>
</site>
<sites>
When starting the service, I get this:
C:\Program Files\IIS Express>iisexpress /path:c:\iis\ /port:80
Copied template config file
'C:\Program Files\IIS Express\AppServer\applicationhost.config'
to 'C:\DOCUME~1\test\LOCALS~1\Temp\iisexpress\applicationhost201311513534137.config'
Updated configuration file 'C:\DOCUME~1\test\LOCALS~1\Temp\iisexpress\applicationhost201311513534137.config' with given cmd line info.
Starting IIS Express ...
Successfully registered URL "http://localhost:80/" for site "Development Web Site" application "/"
Registration completed IIS Express is running. Enter 'Q' to stop IIS Express
And in the actual config file I have this:
<site name="Development Web Site" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="c:\iis\" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:localhost" />
</bindings>
</site>
As the server is bound to localhost, I can't access it remotely.
How can I force the setting to take effect?
Solution: use the /config switch and assign a specific config file so it won't copy the default file and doesn't modify it uncontrollably.
I have IIS express loaded and running from a command line entry. I am using the default applicationhost.config file (I know it's the correct file as I have changed the 1st site's port a couple of times etc).
The strange thing is, I have two sites defined, and it appears only the first one gets loaded? I am sure IIS express can load multiple sites right? as long as different ports?
Here is the <sites> definition bit from the applicationhost.config file:
<sites>
<site name="BF Local SVN" id="1">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\_CODE SOURCECONTROL\BizzfaceLocalSVN" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:6464:localhost" />
</bindings>
</site>
<site name="SquirrelITfreeformBS" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\_CODE SOURCECONTROL\SquirrelITfreeformBS" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:6465: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>
As you can see, two sites defined, different site ID's and different ports?
Any ideas?
When you run iisexpress.exe from command line (without any command line arguments), it starts the first site given in default applicationhost.config file (%userprofile%\documents\iisexpress\config\applicationhost.config).
To start multiple sites, use /apppool switch as shown below;
iisexpress.exe /apppool:Clr4IntegratedAppPool
Above command would start all the applications that are using 'Clr4IntegratedAppPool' app pool.