compiler-errors - MSB3245 :Could not resolve this reference (System. 绘图.成像)

标签 compiler-errors f# visual-studio-code f#-fake

我在 Visual Studio Code 中开发 F#,当我尝试使用 FAKE 编译我的代码时,出现上述错误:
warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Drawing.Imaging". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
然后是一长串“考虑 <various filepaths>,但它不存在”。包括我的 .NET Framework 文件夹和 GAC,这很奇怪。老实说,我希望 Imaging 是在 System.Drawing.dll 中声明的命名空间。 ,但编译器似乎甚至没有考虑这个选项......

我遇到了与 System.Windows.Media 相同的错误, System.Windows.Media.Imaging , 和 System.Windows.Media.IO .可能相关的是 IntelliSense 也没有选择这些命名空间,尽管它确实找到了 System.Drawing.Imaging...

最佳答案

碰巧,我在写它的时候发现了我的问题,但我想我最好把它贴出来,以防其他人有同样的问题。

根本问题是 >F#: Add Reference不工作,我的意思是如果我点击 >F#: Add Reference > <current project> > System.Drawing.Imaging (比如说),似乎没有什么特别的事情发生。如果有人可以解决这个问题并发布他们的答案,我会接受他们的答案并投票,因为这是真正的问题。

为了解决 VSCode 中的错误,我手动编辑了我的 fsproj文件,但似乎我并没有真正理解我在做什么。显然它在给定 <Reference> 时会寻找显式 dll。 s 在我使用的格式中,当然 .Imaging 不存在之类的。一旦我删除了这些错误,这些错误就消失了,不会产生新的错误,比如无法识别 Bitmap。就像我预期的那样。

更新:Add Reference 的问题现在也发现了:当用户名中有空格时,Ionide 显然不会生成正确的 Forge 命令,例如 Windows。

关于compiler-errors - MSB3245 :Could not resolve this reference (System. 绘图.成像),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42313585/

相关文章:

tensorflow - 从源编译tensorflow 1.15 gpu失败

visual-studio-2012 - 在 Visual Studio 2012 中通过 F# Interactive 访问数据文件

haskell - F# 歧视联合中的函数

python - 如何切换打开 jupyter notebook 的环境

objective-c - 导入到 Objc-C 二进制文件中的 Swift 框架无法正确生成 Obj-c header ,错过了 @import Cocoa;

go - 我尝试测试用Go语言编写的代码,但始终收到此错误,并且不知道为什么

java - IntelliJ IDEA 无法解析静态导入

function - F# 纯函数和柯里化(Currying)

javascript - JSDoc 在 VSCode 中的 `exports.default` 处损坏?

javascript - 用于运行 MEANJS 工作流的 Visual Studio Code 配置