Reputation: 3030
I surprisingly didn't find any good answers after a bit of Googling. With .NET Core I can just do dotnet run
, but I'm not sure how to do it on my .NET Framework 4.7 project.
I can build with MSBuild like this: MSBuild.exe *.sln
.
But I can't figure out how to set IISExpress.exe
to launch my MVC project using the settings Visual Studio uses. Ideas?
Upvotes: 3
Views: 5666
Reputation: 457
For my .NET Framework 4.6.1 project, I was able to start my server by these 2 lines of PowerShell script.
PS> cd "C:\Program Files (x86)\IIS Express\"
PS> ./iisexpress /config:E:\Repos\MyProjectFolder\.vs\SolutionName\config\applicationhost.config /site:MyProjectName
To find the equivalent script for your project I recommend the following.
applicationhost.config
file. IIS Express uses this file to start the projects in Visual Studio. It usually resides in .vs
folder. Here's the complete path E:\Repos\MyProjectFolder\.vs\SolutionName\config\applicationhost.config
iisexpress.exe
. For me, path is C:\Program Files (x86)\IIS Express\iisexpress.exe
.applicationhost.config
full path and the site you wish to start.NOTE: The site/project must be listed on your applicationhost.config
file like shown below.
<sites>
<site name="MyProjectName" id="1">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="E:\Repos\MyProjectFolder\" />
</application>
<bindings>
<binding protocol="https" bindingInformation="*:44466:localhost" />
<binding protocol="http" bindingInformation="*:12435:localhost" />
</bindings>
</site>
</sites>
Upvotes: 5