简体   繁体   English

服务器计算机上的程序集引用异常。 在本地运行良好

[英]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.

相关问题 本地计算机上的 GetProcesses 导致“无法连接到远程计算机”。 - GetProcesses on local machine results in “Couldn't connect to remote machine.” ''Microsoft.ACE.OLEDB.12.0' 提供程序未在本地计算机上注册。' - 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.' “Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。 - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Ajax自动完成CSS在iis和服务器上工作正常,但在本地计算机上工作不正常 - Ajax Auto complete Css works fine in iis and the server but not in local machine 在服务器中获取“索引超出数组范围”异常,本地工作正常 - Getting “Index was outside the bounds of the array” exception in server, local works fine 发布到服务器后无法显示/打开Excel文档! 在本地计算机上很好,但在服务器上没有 - Unable to display/open excel document after published to server! It's fine on local machine but not on server “未在本地计算机上注册'Microsoft.ACE.oledb.12.0'提供程序的在线错误。” - online error of “The 'Microsoft.ACE.oledb.12.0' provider is not registered on the local machine.” 一些有关“ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册的问题。 - Some issue about “The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.” “ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。 错误 - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Error “ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。 C# - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM