.net 不在同一个解决方案中的 Dll 文件引用

木房尘埃 2010-11-01 08:22:46
在一个网站中引用了另外一个小网站中的所以Dll 在本地代码测试没有问题

在服务器上访问的Using 项目名称

但是无法访问到项目下的类型

错误提示如下:



Server Error in '/eProcess' Application.
--------------------------------------------------------------------------------

Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 312: protected void btnLogin_Click(object sender, EventArgs e)
Line 313: {//MediaSystem 中的密码验证
Line 314: Apply.DoLogin login = new Apply.DoLogin();
Line 315: string straccount = this.txtAccount.Text.Trim();
Line 316:


Source File: c:\Program Files\Dltech\LiveFlowNet V5.3\WebSite\LiveFlowWeb\LoginNoAD.aspx.cs Line: 314

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


...全文
91 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
木房尘埃 2010-11-02
  • 打赏
  • 举报
回复
O(∩_∩)O哈哈~ 谢谢问题解决了 估计是服务器上的环境部一样造成的 ,放了一个Dll 进去就可以了 。。
zhubo006 2010-11-02
  • 打赏
  • 举报
回复
罗纳尔迪尼奥 2010-11-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 liuwei2500 的回复:]

这个是服务器上面缺少程序集System.Data.SqlServerCe造成的,例如你在你的程序里面使用了调用了office的方法,在你的电脑上面装有office【会自动安装office的程序集到.net的程序集下面】那么就没问题,而你的服务器上面没有office的话,就会出现这样的错误。
[/Quote]
学习····
sage425 2010-11-01
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 liuwei2500 的回复:]

这个是服务器上面缺少程序集System.Data.SqlServerCe造成的,例如你在你的程序里面使用了调用了office的方法,在你的电脑上面装有office【会自动安装office的程序集到.net的程序集下面】那么就没问题,而你的服务器上面没有office的话,就会出现这样的错误。
[/Quote]

嗯,是的 回答的很好,少了程序集。你不上就差不多了
liuwei2500 2010-11-01
  • 打赏
  • 举报
回复
这个是服务器上面缺少程序集System.Data.SqlServerCe造成的,例如你在你的程序里面使用了调用了office的方法,在你的电脑上面装有office【会自动安装office的程序集到.net的程序集下面】那么就没问题,而你的服务器上面没有office的话,就会出现这样的错误。
Json.NET 描述: json。 网络是一个流行的高性能JSON为。NET框架 灵活的JSON序列化器对之间的转换。净对象和JSON linq到JSON用于手动阅读和写作JSON 高性能,速度比。净的内置JSON序列化器 写缩进,容易阅读JSON JSON和XML之间进行转换 支持: .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store 版本: Json.NET has different libaries for the various .NET Framework versions. -Net45: .NET latest (4.5) -Net40: .NET 4.0 -Net35: .NET 3.5 -Net20: .NET 2.0 -WinRT: Windows 8 Store -Portable45: .NET 4.5, Windows Phone 8, Windows 8 Store -Portable40: .NET 4.0, Windows Phone 7, Windows 8 Store, Silverlight 4 Notes: Microsoft stopped support for the Compact Framework in Visual Studio 2010. For a Compact Framework 3.5 build download Json.NET 3.5. For a Silverlight 3.0 build download Json.NET 3.5. Microsoft Visual Studio 2010 重新生成解决方案的一些警告处理 警告 2 预定义类型“System.Action”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 3 预定义类型“System.Action”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 4 预定义类型“System.Action”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 5 预定义类型“System.Action”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 6 预定义类型“System.Func”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 7 预定义类型“System.Func”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 8 预定义类型“System.Func”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 9 预定义类型“System.Func”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 警告 10 预定义类型“System.Func”是在全局别名的多个程序集定义的;将使用“c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework \v4.0\mscorlib.dll的定义 ClassLibrary1 问题原因:检查程序发现,由于项目引用了Newtonsoft.Json.Net20,从而造成系统的类重名(项目FRAMEWORK的版本4.0)。 Newtonsoft.Json.Net 包括: .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store,所有dll文件和源码,有需要的同学可以直接下载。 个人网站多多支持:www.mlyuansu.com

62,072

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧