Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/IISExpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IExpressArguments {
port: number;
clr: settings.clrVersion;
protocol: settings.protocolType;
apps: string[];
}

export class IISExpress {
Expand Down Expand Up @@ -65,7 +66,10 @@ export class IISExpress {
clr: options.clr ? options.clr : settings.clrVersion.v40,

// If no protocol set fallback to http as opposed to https
protocol: options.protocol ? options.protocol : settings.protocolType.http
protocol: options.protocol ? options.protocol : settings.protocolType.http,

// Collection of Folders to treat as Applications
apps: options.apps || []
};


Expand Down Expand Up @@ -124,6 +128,21 @@ export class IISExpress {
this._reporter.sendTelemetryException(error, {"appCmdPath": this._iisAppCmdPath});
}

// Add Applications to the site
// appcmd add app /site.name:Site-Staging-201ec232-2906-4052-a431-727ec57b5b2e /path:/SubApp /physicalPath:C:\Site\SubApp /applicationPool:Clr2IntegratedAppPool
if(this._args.apps.length !== 0){
this._args.apps.forEach((app) => {
let physicalPath = path.join(this._args.path, app);
try {
process.execFileSync(this._iisAppCmdPath, ['add', 'app', `/site.name:${siteName}`, `/path:${app}`, `/physicalPath:${physicalPath}`, `/applicationPool:${appPool}`]);
}
catch (error:any) {
console.log(error);
this._reporter.sendTelemetryException(error, { "appCmdPath": this._iisAppCmdPath });
}
});
}

// Log telemtry
telemtry.updateCountAndReport(this._context, this._reporter, telemtry.keys.start);
telemtry.updateCountAndReport(this._context, this._reporter, telemtry.keys.sponsorware);
Expand Down
3 changes: 2 additions & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Isettings {
url?: string;
clr: clrVersion;
protocol: protocolType;
apps?: string[];
}

export enum clrVersion {
Expand Down Expand Up @@ -127,4 +128,4 @@ export function getSettings(uri:vscode.Uri| undefined):Isettings{
// http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-without-administrative-privileges
export function getRandomPort():number{
return util.getRandomIntInclusive(1024,44399);
}
}