在部署网站缺少using指令或程序集引用错误 [英] Missing a using directive or an assembly reference error upon deploying the website

查看:247
本文介绍了在部署网站缺少using指令或程序集引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,其中* cs文件在于APP_ code文件夹(同时增加在我的项目一类的项目,VS2010建议我创建这个文件夹)。我有一个default.aspx.cs文件,这使得使用这个类。当我在VS2010中运行它运行没有任何错误。

I have a website, where the *.cs file lies in the App_Code folder (while adding a class item in my project, VS2010 suggested me to create this folder). I have a default.aspx.cs file which makes use of this class. It runs without any error when I run on VS2010.

然而,当我通过专用托管公司部署在Web服务器的网站。它给我这个错误:

However, when I deployed the website on the webserver via a private hosting company. It gives me this error:

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. 

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

和它的指向code的我在哪里实例化类的对象行:

And its pointing to the line of code where I am instantiating the object of the class:

Line 84:         SMSAPP obj = new SMSAPP();

究竟去从本地版本错误的托管版本?请帮忙。谢谢。

What exactly went wrong from the local version to the hosted version? Please help. Thanks.

我所学到的:

好了,所以我一直无法运行我的项目呢。但我学到了一些东西,我想西安商贸大厦的Web应用程序和网站是完全不同的事情。我的是一个网站,这就是为什么*的.cs code的财产没有选项建设行动=编译。我将我的项目,从网站到Web应用程序,我可以看到被建议在答案选择这里。然而,在部署没有运气。

Okay, so I haven't been able to run my project yet. But I learned few things which I would like to share- web applications and web sites are totally different things. Mine was a website, that's why the *.cs code's property did not have option to "Build Action" = "Compile". I converted my project from website to web application, and I could see the options being suggested in the answers here. However, no luck in the deployment.

推荐答案

在cs文件,并选择属性点击鼠标右键,然后检查建设行动是设置为编译

Right mouse click on the .cs file and select properties then check if the "Build action" is set to "Compile"

这篇关于在部署网站缺少using指令或程序集引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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