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

Launching IIS Express should include the 'site-id' parameter #34

Closed
Shazwazza opened this issue Jan 8, 2018 · 3 comments
Closed

Launching IIS Express should include the 'site-id' parameter #34

Shazwazza opened this issue Jan 8, 2018 · 3 comments
Labels

Comments

@Shazwazza
Copy link

See site-id parameter here: https://docs.microsoft.com/en-us/iis/extensions/using-iis-express/running-iis-express-from-the-command-line

What is currently happening is that whenever IIS Express starts, it is using a generated Site ID which equates to the AppDomain.AppDomainAppId parameter. In Umbraco, this value is used to distinguish one site running on a single server from another and is used for file naming with regards to load balancing.

Since this Id is regenerated each time you restart the IIS Express in VSCode, this means Umbraco will 'cold boot' because it thinks its a new server. In the real IIS and IIS Express worlds (within VS), this ID is static and remains the same.

It should be possible to perhaps SHA1 hash the folder path and generate an Integer ID ... but i don't know what size of an integer value can be passed to this parameter since an integer of a SHA1 would probably be a pretty big number

@warrenbuckley
Copy link
Owner

Hey @Shazwazza I will see if I can look at this on a FF & may ping you for some thoughts nearer to the time.

@warrenbuckley
Copy link
Owner

@Shazwazza A site is added & removed from the applicationHost.config file with appcmd.exe

We add to the file everytime the site is run & when ever we stop the site (with VS Code extension, close VS Code or kill IIS Express directly) We also attempt to cleanup/remove the entry from applicationHost.config

Looking at the docs for appcmd.exe I can create a site entry with a specific siteId property when we create it & run it from that integer instead when we invoke IISExpress to start the site.

So as long as I have the site id integer generate the same int every time - from your SHA1 hash suggestion of the path of the folder, then this should resolve the problem your having?

As the extension will try to cleanup still & keep the applicationHost.config neat & tidy or does it need to be a permanent entry in applicationHost.config in order to resolve the issue your having?

Once I know then I can work on this & fix it up.

@warrenbuckley
Copy link
Owner

This was done and the issue never closed

//Site name is the name of the workspace folder & GUID/UUID
//Need to append a UUID as could have two folders/sites with same name
var siteName = path.basename(vscode.workspace.rootPath as string) + "-" + uuidV4();

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

No branches or pull requests

2 participants