3

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?

1

1 Answer 1

5

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.

  1. Find the location of 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
  2. Find iisexpress.exe. For me, path is C:\Program Files (x86)\IIS Express\iisexpress.exe.
  3. Start IIS Express server by specifying the 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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.