[英]Assembly reference exception on Server machine. Running fine on local
I have developed the project using Entity Framework 5. I created the object of the Entity class. 我已经使用Entity Framework 5开发了该项目。我创建了Entity类的对象。 It works fine on my local machine but when I am trying to run on my Server machine it gives me an 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 'DataExportSystemEntities' could not be found (are you missing a using directive or an assembly reference?) 编译器错误消息:CS0246:找不到类型或名称空间名称'DataExportSystemEntities'(是否缺少using指令或程序集引用?)
Source Error: 源错误:
Line 11: public partial class Servers : System.Web.UI.Page
Line 12: {
Line 13: DataExportSystemEntities db = new DataExportSystemEntities();
Line 14: protected void Page_Load(object sender, EventArgs e)
Line 15: {
Entity framework dll is present in the bin folder. 实体框架dll位于bin文件夹中。
This is probably your assembly, built using Entity Framework. 这可能是您使用实体框架构建的程序集。 You've got a copy of it in your bin folder or something locally, but when you deploy it to the server the dll is missing. 您已经在bin文件夹或本地文件中得到了它的副本,但是当将其部署到服务器时,dll丢失了。
I'd say make sure you've added a reference to your assembly that has the DataExportSystemEntities
namespace in it (probably a project where you've implemented your data model using EF) to the project that gives you the error when you try to build the solution. 我想确保您已在其中添加了具有DataExportSystemEntities
命名空间的程序集DataExportSystemEntities
(可能是您使用EF实现数据模型的项目)到了在尝试构建时会给您错误的项目解决方案。
One way to track down what assembly has that DataExportSystemEntities
class is to do a Find in Files search in every relevant solution you have and see where it's defined. 跟踪DataExportSystemEntities
类具有什么程序集的一种方法是在您拥有的每个相关解决方案中进行“在文件中查找”搜索,并查看其定义位置。 The name really implies that it's something created for your data model. 该名称实际上意味着它是为您的数据模型创建的。 If the definition isn't found in your source code it's probably a 3rd party assembly that needs to get included in your deployment to the server. 如果在源代码中找不到该定义,则可能是第三方程序集需要包含在服务器的部署中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.