【发布时间】:2017-12-31 12:04:47
【问题描述】:
我正在尝试在 c# 中使用 Json.net 来编写一个 json 文件。当我构建代码时,它构建得很好并创建了一个 parser.exe。但是当我尝试在需要运行的单独服务器上运行该 parser.exe 时,它会给我一个错误
System.IO.FileNotFoudException: Could not load file or assembly
'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4f...'
or one of its dependencies. The system cannot file the file specified.
我是否需要将 Newtonsoft dll 复制到它需要运行的服务器。任何帮助都会 非常感谢。
【问题讨论】:
-
是的。您需要将所有依赖的程序集、库和 dll 复制到运行 exe 的目标位置。
-
您使用的是什么类型的 IDE?
-
我正在使用 Visual Studio 社区版 2015
-
输出是否包含名为“Newtonsoft.Json.dll”的文件?
-
我将 dll 复制到它运行的服务器上的同一路径,但它仍然给我同样的错误 C:\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll