0

I am trying to simplify some of the start-of-day tasks that me and the other developers must do at my company. In order to get our local dev environments running, we have to go through a series of steps: starting VMs, APIs, and other web servers. My goal is to write a script to automate all of this.

The only part that is giving me difficulty is one step in particular where we must start a gateway API project written in .NET Framework before starting the other microservice APIs written in .NET Core. The .NET Core APIs can easily be started via a script which we already use, but I was hoping to make the .NET Framework project part of this script too, which must come first before the other .NET Core APIs. Currently we open the .NET Framework project in Visual Studio, press Run, then run the script to start the other .NET Core APIs.

Does anyone have any pointers on how I can automate starting the .NET Framework project?

  • 1
    Related - [MSBuild: What is it, and when do I need it?](https://stackoverflow.com/questions/3603100/msbuild-what-is-it-and-when-do-i-need-it). – Anoop R Desai Sep 16 '19 at 19:12

1 Answers1

0

I assume you're using IIS Express for debugging, which means you have to open Visual Studio and start debugging for your website to start.

I suggest you install full IIS (not Express) on your machine. It has the benefits of:

  1. You can still debug in Visual Studio
  2. The application will always respond to requests, whether Visual Studio is running or not.

To do this:

  1. In the Start Menu search for and open 'Programs and Features'
  2. Click 'Turn Windows features on or off' on the left
  3. Select 'Internet Information Services' in the list, with all the features you want (pretty much everything under 'World Wide Web Services' and at least 'IIS Management Console' under 'Web Management Tools')

IIS Install

I assume from there you know how to setup the website in IIS Manager. Do it the same as you would on a production server. Just point the site (or virtual folder) to where your code is.

In your Visual Studio project:

  1. Open Project -> [Project Name] Properties...
  2. Click 'Web' on the left
  3. Under 'Servers', select "Local IIS" from the dropdown
  4. Make sure the 'Project Url' matches where you set it up in IIS

There is also a "Create Virtual Folder" button there in Visual Studio that can help you set up the site, if you prefer.

Gabriel Luci
  • 38,328
  • 4
  • 55
  • 84