ASP.NET Core 2.0站点-FileIOException System.Runtime [英] ASP.NET Core 2.0 Site - FileIOException System.Runtime

查看:42
本文介绍了ASP.NET Core 2.0站点-FileIOException System.Runtime的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个同事已经为我们的下一份工作整理了一些基础项目.这些项目在他的机器上可以正常工作,并且我们的开发服务器之一可以很好地托管开发实例.这些项目在我们刚建立时或多或少是空的.由一个静态html文件组成.

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:

"System.IO.FileNotFoundException"类型的未处理异常发生在未知模块中.无法加载文件或程序集'System.Runtime,版本= 4.2.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a'或其依赖项之一.这系统找不到指定的文件.

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.

  • 核心SDK
  • 核心运行时
  • WindowsHosting

dotnet restore 已运行,我们正在使用 yarn 进行依赖项管理.

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

我可以使用 dotnet新敲除创建一个站点,然后打开生成的站点并正常运行,因此我确定.NET Core已安装并正常工作.

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.

到目前为止,我对.NET Core的经验有限,并且已尝试尽我所知来解决这一问题.任何有关这里出了什么问题的指针,将不胜感激.

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.

推荐答案

因此,经过一番摸索,看来我已经解决了问题.

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

我做了什么:

  • 将单个项目从原始解决方案复制到新目录中
  • 打开VS2017
  • 打开了这个单一项目
  • VS打开项目并立即构建一个Properties目录和launchOptions.json文件
  • 该项目运行良好

这似乎已经唤醒"了某些东西.

This seems to have "woken" something up.

当我重新打开原始解决方案时,它为以前没有执行过的每个项目构建了Properties目录和launchOptions.json文件.

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.

我还注意到Visual Studio UI是不同的.以前,文件"菜单甚至没有关闭解决方案选项.

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

非常非常奇怪.

这篇关于ASP.NET Core 2.0站点-FileIOException System.Runtime的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆