Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of the virtual directory failed #1950

Closed
asbjornu opened this issue Mar 7, 2014 · 9 comments · Fixed by #2119
Closed

Creation of the virtual directory failed #1950

asbjornu opened this issue Mar 7, 2014 · 9 comments · Fixed by #2119
Milestone

Comments

@asbjornu
Copy link

asbjornu commented Mar 7, 2014

I've followed the steps outlined in the readme.md files and have run both build.cmd and the .\tools\Enable-LocalTestMe.ps1 file. I can confirm this by opening readme.localtest.me in a browser; it shows the readme website as expected.

However, when I try to load the NuGetGallery.csproj file in Visual Studio, I get the following error message: Creation of the virtual directory http://nuget.localtest.me failed with the error: Cannot create the Web site 'http://nuget.localtest.me'. You must specify "localhost" for the server name.

How do I get around this?

@yannduran
Copy link

I'm getting exactly the same error. It's disappointing to see that nobody has replied with any suggestion on how to fx it.

@phatcher
Copy link

phatcher commented May 5, 2014

I had this one, check whether your applicationhost.config has the website defined - if you are not an admin, this will have been created in the admin's config file rather than your own.

Copy the details from that config to yours (change the id if necessary), the full path is User\Documents\IISExpress\config\applicationhost.config

@robertmuehsig
Copy link
Contributor

Just a couple of minutes ago I fighted against this issue as well. It worked for me on 3 machines, but failed by my colleague. Reason was: He used a German Windows Version, so this lines (in the Enable-LocalTestMe.ps1) must be "localized":

Invoke-Netsh http add urlacl "url=http://$Subdomain.localtest.me:80/" user=Everyone
Invoke-Netsh http add urlacl "url=https://$Subdomain.localtest.me:443/" user=Everyone

Change "Everyone" to "Jeder" in German.

@analogrelay
Copy link
Contributor

I wonder if using the SID (S-1-1-0) would be better since it's not a localized name.

@robertmuehsig
Copy link
Contributor

It seems you can't insert a SID in the "user" parameter (I'm not an expert in netsh ;) ), but maybe the sddl parameter will do the trick:
netsh http add urlacl "url=http://test1.localtest.me:80/" sddl=D:(A;;GX;;;S-1-1-0)

I'm not sure if this is the same as "user=Everyone", but from the "netsh http show urlacl" it seems identical

Made with the "user" parameter (on my English machine):
Reserved URL : https://nuget.localtest.me:443/
User: \Everyone
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;WD)

Made with the "sddl" + SID parameter:
Reserved URL : http://test1.localtest.me:80/
User: \Everyone
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;WD)

Seems also to work on a German machine:
Reservierte URL : http://test.localtest.me:80/
Benutzer: \Jeder
Abhören: Yes
Delegieren: No
SDDL: D:(A;;GX;;;WD)

IMHO would be helpful for beginners and would remove one error source.

robertmuehsig added a commit to robertmuehsig/NuGetGallery that referenced this issue May 6, 2014
user=Everyone only works on EN Windows Versions.
Idea was given in this issue NuGet#1950
@analogrelay analogrelay added this to the D4 milestone May 7, 2014
@CumpsD
Copy link
Contributor

CumpsD commented May 12, 2014

I'm actually getting this, when I try to run with CTRL+F5

Unable to launch the IIS Express Web server.

Failed to register URL "https://localhost:443/" for site "NuGetGallery" application "/". 
Error description: Access is denied. (0x80070005)

OK

If I run with F5, it all works.

I've looked around the solution, but not a single property in my settings refers to https or 443 (I've set the project url to http://localhost:8090

Anyone who might give me a nudge in the right direction?

@robertmuehsig
Copy link
Contributor

Did you run the EnableLocalTestMe.ps1? Did you change the project settings?

@CumpsD
Copy link
Contributor

CumpsD commented May 15, 2014

Seems something went wrong with the EnableLocalTestMe

PS c:\Src\GitHub\NuGetGallery\tools> .\Enable-LocalTestMe.ps1
WARNING: Site 'NuGet Gallery (nuget.localtest.me)' already exists. Deleting and recreating.
SITE object "NuGet Gallery (nuget.localtest.me)" deleted
SITE object "NuGet Gallery (nuget.localtest.me)" added
APP object "NuGet Gallery (nuget.localtest.me)/" added
VDIR object "NuGet Gallery (nuget.localtest.me)/" added
Using SSL Certificate: 170567E273A1E371322BCED956D57302647FAEDC
'hostnameport' is not a valid argument for this command. The syntax supplied for this command is not valid. Check help for the correct syntax.                                  Usage: add sslcert [ipport=]<IP Address:port>               [certhash=]<string>               [appid=]<GUID>               [[certstorename=]<string>                [verifyclientcertrevocation=]enable|disable                [verifyrevocationwithcachedclientcertonly=]enable|disable                [usagecheck=]enable|disable                [revocationfreshnesstime=]<u-int>                [urlretrievaltimeout=]<u-int>                [sslctlidentifier=]<string>                [sslctlstorename=]<string>                [dsmapperusage=]enable|disable                [clientcertnegotiation=]enable|disable]          Parameters:            Tag                       Value           ipport                  - IP address and port for the binding.          certhash                - The SHA hash of the certificate. This hash                                    is 20 bytes long and specified as a hex                                    string.          appid                   - GUID to identify the owning application.
        certstorename           - Store name for the certificate. Defaults                                    to MY. Certificate must be stored in the                                    local machine context.          verifyclientcertrevocation - Turns on/off verification of revocation                                       of client certificates.                         verifyrevocationwithcachedclientcertonly - Turns on/off usage of
              only cached client                                                     certificate for revocation checking.          usagecheck              - Turns on/off usage check. Default is enabled.          revocationfreshnesstime - Time interval to check for an updated                                    certificate revocation list (CRL). If this                                    value is 0, then the new CRL is updated                                       only if the previous one expires. (in                                    seconds)          urlretrievaltimeout     - Timeout on attempt to retrieve certificate                                    revocation list for the remote URL.
                          (in milliseconds)               sslctlidentifier        - List the certificate issuers that can                                    be trusted. This list can be a subset of                                    the certificate issuers that are trusted                                    by the machine.          sslctlstorename         - Store name under LOCAL_MACHINE where                                          SslCtlIdentifier is stored.
              dsmapperusage           - Turns on/off DS mappers. Default is                                    disabled.          clientcertnegotiation   - Turns on/off negotiation of certificate.                                    Default is disabled.                                                                                Remarks: adds a new SSL server certificate binding and corresponding client           certificate policies for an IP address and port.   Examples:                                                                                                                                                          add sslcert ipport=1.1.1.1:443 certhash=0102030405060708090A0B0C0D0E0F1011121314 appid={00112233-4455-6677-8899-AABBCCDDEEFF}
Ready! All you have to do now is go to your website project properties and set 'http://nuget.localtest.me' as your Project URL!

But, I don't understand why it wants to bind to https:// 443, where is this defined? Why does it do this when I run in DEBUG, but with CTLR+F5? Where does this setting come from? (There is no magic!)

In dev I don't really mind about https, I just want it to run, it's ok if it's over http on my local machine, and it's also ok to use "localhost:12345" or whatever

@CumpsD
Copy link
Contributor

CumpsD commented May 15, 2014

Nevermind..... it was the project Properties (not the "Properties" subnode, but the VS Properties, and set "SSL Enabled" to false.... doh!

Always miss those properties, so very well hidden

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants