类型或命名空间名称“Newtonsoft”找不到 [英] type or namespace name 'Newtonsoft' could not be found

查看:7447
本文介绍了类型或命名空间名称“Newtonsoft”找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看这个问题,但我没有看到太多的答案,显然没有任何有帮助的还是我不会问。我是一个.NET新手。

I've looked this question up, but I don't see too many answers, and obviously none have been helpful or I wouldn't be asking. I am a .NET neophyte.

我的本地环境的Win7,微软虚拟Web开发人员2010例preSS。我加入了NewtonSoft.Json作为一个自定义组件库。

My local environment is Win7, Microsoft Virtual Web Developer 2010 Express. I added the NewtonSoft.Json as a custom component library.

  • 我建立了一个简单的HelloWorldWeb服务,使用Newtonsoft.Json自定义组件。

  • I built a simple "HelloWorld" web service, using Newtonsoft.Json custom components.

当我做一个版本我的本地机器(的Visual Web Developer 2010例preSS),它的伟大工程。事实上,我得到一个有效的JSONP输出,而不是XML。

When I do a build on my local machine (Visual Web Developer 2010 Express) it works great. I actually get a valid JSONP output, not XML.

在我的FTP我的文件到远程Web服务器,我的网络服务无法正常工作。我得到这样的:

When I FTP my files to the remote web server, my web service does not work. I get this:

编译错误说明:在发生错误   资源编译需要此请求提供服务。请   检查下列特定错误详细信息并修改源   code正确。

Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

编译器错误信息:CS0246:的类型或命名空间名称   Newtonsoft'找不到(是否缺少using指令或   程序集引用?)

Compiler Error Message: CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)

源错误:

7号线:使用System.Web.Services.Protocols;

Line 7: using System.Web.Services.Protocols;

8号线:使用System.Web.Script.Services;

Line 8: using System.Web.Script.Services;

第9行:使用Newtonsoft.Json;

Line 9: using Newtonsoft.Json;

第10行:

11号线:命名空间System.Web.Script.Services.CS

Line 11: namespace System.Web.Script.Services.CS

我已经试过各种抄袭我的整个项目文件夹,远程文件夹,然后删除一切,只是复制我的ASMX和web.config文件,我仍然得到错误。我复制bin文件夹,用Newtonsoft.Json.dll到远程服务器,然后试图将其复制到根文件夹,都无济于事。

I have tried everything from copying my entire project folder to the remote folder, then deleting everything and just copying my asmx and web.config file, and I still get the error. I copied the bin folder, with the Newtonsoft.Json.dll to the remote server, then tried copying it into the root folder, and to no avail.

是否有必须在远程服务器上执行,以使​​其能够使用Newtonsoft.Json.dll一些操作

Is there some operation that must be performed on the remote server to enable it to use Newtonsoft.Json.dll?

推荐答案

谢谢你的指针和链接。挣扎后,我得到它的工作。什么事终于发生了是我的朋友,在.NET专家Skyped我,并通过部署我的项目到目标服务器的正确方法说服我。我不明白,有你的地方去构建一个单独的文件夹。我做了一个生成部署包作为一个zip文件。然后,我解压缩它在我的硬盘驱动器,并把它放进一个干净的文件夹中的Web服务器(实际上,我上传到根目录)上,瞧,它的工作。

Thanks for the pointer and the link. After a struggle I got it to work. What finally happened was my friend, an expert in .NET Skyped me and talked me through the proper way of deploying my project to the destination server. I didn't understand that there is a separate folder where your Build goes. I made a "Build Deployment Package" as a zip file. Then I unzipped it on my hard drive, and dropped it into a clean folder on the web server (actually, I uploaded it to the root directory), and voila, it worked.

这篇关于类型或命名空间名称“Newtonsoft”找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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