无法加载文件或程序集“Microsoft.Exchange.WebServices,Version=14.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”
我正在开发一个访问 Exchange Server 的项目。在我将项目替换为服务器之前,一切都很顺利。但现在我收到了这个错误。
我在谷歌中找不到我搜索的内容,所以我希望你们能帮助我。我很欣赏这一点。
I'm working on a project that accesses the Exchange Server. Before I replaced the project to a server, everything went fine. But now I'm getting this error.
I don't find what I search in Google, so I hope someone of you can help me. I appreciate that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您应该为您的应用程序提供指定的程序集或将其安装在您的服务器上。
You should provide the specified assembly with your application or install it on your server.
答案是:我将 dll 和 xml 文件(安装 EWS 托管 API 时获得的文件)复制到我的项目的 bin 文件夹中。它有效!
The answer is: I copied the dll and xml file (which you get when installing EWS Managed API) to the bin-folder of my project. And it works!
我在 VS2005、.Net 2 和 3.5 中遇到了同样的错误,
这就是我解决它的方法,我必须找到另一个解决方案,因为这总是失败,Windows 不会让我注册 DLL。
我从 Windows XP 中的管理工具进入 .Net Framework 配置向导。我的是.NET Framework 2.0 配置(版本2.0.50727.42)。
然后我进入运行时安全策略 ->增加程序集信任并指向我的 C 盘中的上述 DLL。由于某种原因,它被设置为“不信任”!我将其更改为“完全信任”。
然后我关闭并重新打开我的 VS2005 项目,现在一切正常。
问候,
I had the same exact error, in VS2005, .Net 2 and 3.5
This is how I resolved it, and I had to find another solution, because this always failed and Windows would not let me register the DLL.
I went into the .Net Framework Configuration Wizard from Administration tools in Windows XP. Mine is .NET Framework 2.0 Configuration (version 2.0.50727.42).
I then went into Runtime Security Policy -> Increase Assembly Trust and pointed to the above DLL in my C drive. It was set to NO TRUST, for some reason! I changed it to FULL TRUST.
I then closed and re-opened my VS2005 project and everything is now working fine.
Regards,
有两种解决方案,但取决于哪一种解决您的问题
解决方案 1 - 您需要添加 Nuget 引用。在您的项目中,右键单击“引用”,然后单击“管理 Nuget 包”,然后在浏览选项卡中搜索 microsoft.Exchange.webservices 并安装:)
解决方案 2 - 您需要添加引用。在您的项目中,右键单击“引用”,然后单击“添加引用”,然后转到此处,将 system.web.services 添加到您的项目中。
There are two solutions but depends on which one solves your issue
solution 1- You need to add a Nuget Reference. In your project, right click "References" and click "manage Nuget packages" Then In the browse tab Search microsoft.Exchange.webservices and install :)
solution 2- You need to add a Reference. In your project, right click "References" and click "Add reference" Then go here and add system.web.services to your project.