Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core 2.0 Site - FileIOException System.Runtime

A colleague has been putting together some skeleton projects for our next job. The projects work fine on his machine and one of our development servers is hosting the dev instance fine. These projects are more or less empty as we are just setting up. The consist of a single static html file.

The projects build fine on my dev machine but as soon as a select one of the project and attempt to debug it fails with:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Could not load file or assembly 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I've triple checked that I've installed all the dependencies.

  • The Core SDK
  • The Core Runtime
  • WindowsHosting

dotnet restore Has been run and we're using yarn for dependency management.

I can create a site using dotnet new knockout and open the resultant site and run it fine so I'm sure .NET Core is all installed and working.

I've limited experience with .NET Core so far and have tried everything I know to figure this one out. Any pointers as to what is going wrong here would be most appreciated.

like image 326
Jammer Avatar asked Mar 07 '18 15:03

Jammer


1 Answers

So after a lot of poking around it appears I've fixed my scenario.

What I did:

  • Copied a single project from the original solution into a new directory
  • Opened VS2017
  • Opened this singular project
  • VS open the project and immdiately built a Properties directory and launchOptions.json file
  • This project ran fine

This seems to have "woken" something up.

When I then re-opened the original solution it built the Properties directories and launchOptions.json files for each project wheras it didn't do this before.

I've also noticed that the Visual Studio UI is different. Previously the File menu didn't even have a close solution option available.

All very, very odd.

like image 169
Jammer Avatar answered Sep 25 '22 15:09

Jammer