I'm creating a website using MVC (Visual Studio) and I get error "spawn unknown" when I debug using IIS Express. What is causing this error and how can I resolve it?
This is using Visual Studio 2017, but I suspect it could be something to do with the way it's configured on my computer, since this error doesn't occur on other computers.
This is the view:
@model WebApplication4.Models.Customer
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
And the controller:
namespace WebApplication4.Controllers
{
public class CustomerController : Controller
{
private ApplicationDbContext _context;
public CustomerController()
{
_context = new ApplicationDbContext();
}
// GET: Customer
public ActionResult Index(int id)
{
var customers = _context.Customers.ToList();
return View(customers);
}
}
And the model:
namespace WebApplication4.Models
{
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public Membership MembershipType { get; set; }
}
public enum Membership
{
REGULAR,
SILVER,
GOLD
};
}
When I debug the solution with IIS Express, instead of opening Chrome and displaying the index page, I get a pop-up box from Microsoft Visual Studio, saying: One or more errors occurred. [debugger-for-chrome] Error processing "launch":spawn UNKNOWN
There are numerous questions on "spawn unknown" but none concerning C# or MVC (generally node.js or php - there is a question about the error in VS here but it's about a pop-up that appears after opening .php extension files. According to this answer: Error: spawn UNKNOWN it looks like the issue is to do with using Chrome as the web browser. However is it possible to change IIS Express to use something other than Chrome?