Microsoft.Exchange.WebServices没有在VS2010工作 [英] Microsoft.Exchange.WebServices is not working in VS2010
问题描述
I'n使用EWS ExchangeService读取Outlook电子邮件...我编写的在控制台项目和VS2008 ...一切正常,因为它是..我可以阅读电子邮件。
I'n using EWS ExchangeService to read emails from outlook... I've coded the in Console project and in VS2008... Everything works fine as it is.. I can read the emails.
要更加familair与VS2010我创建了一个控制台项目和复制拷贝到VS2010的项目。
To become more familair with VS2010 I created a console project and copied the copied to VS2010 project.
所以我在Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange添加refereneMicrosoft.Exchange.WebServices(版本14.2.51.0) .WebServices.dll文件夹中。
so I added the referene "Microsoft.Exchange.WebServices" (Version 14.2.51.0) in Microsoft\Exchange\Web Services\1.1\Microsoft.Exchange.WebServices.dll folder.
一切正常,因为它是,所以我看到了intellisence,我看到Exhange装配等方法属性...
Everything works as it is, so I see the intellisence, I see the methods properties of Exhange assembly etc...
问题:
- 当我点击在VS2010构建按钮后...我得到这个错误:
类型或命名空间名称'交易所'不命名空间中存在的'微软' (是否缺少程序集引用?)表这里所有的方法/交换组件的性能被挤压下划线... Intellisence不工作的Exchange组件了。当我从参考,并重新加入我得到的intellesence回来的Exchange组件中卸下......但是当我在构建:(
。单击让我转到我的代码,然后键入它再次发生微软。我看不到交换字了......
The issue: - As soon as I click on the build button in VS2010... I get this error: The type or namespace name 'Exchange' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Form here all the methods/properties of Exchange assembly get squeezed underline... Intellisence is not working for Exchange assembly anymore. When I remove the assembly from reference and re-added I get the intellesence back again for Exchange assembly... but it happens again when I click on build :( so I goto my code and type "Microsoft." I don't see the Exchange word anymore....
所以我不明白,为什么发生这种情况,它适用于VS2008和VS2010它不工作?唯一的方式,我认为是VS是框架3.5和VS2010为V4.0
So I don't understand why this occurs, it works on VS2008 and in VS2010 it's not working? The only way I think is VS was Framework 3.5 and VS2010 is V4.0
任何想法去哪里找?如何解决这个问题呢?
any idea where to look? and how to solve this problem?
- 我需要得到电子邮件的附件..所以当电子邮件到达专用电子邮件帐户,我需要得到附件及附件文件保存到特定的文件夹。这里什么是最好的方法吗?创建控制台项目中的代码,并创建Windows服务项目?或者只是控制台项目或只是Classlibrry项目,并添加到任务计划程序?所以,我需要这方面的一些建议如何在项目层面...编程逻辑已经在那里工作的办法。
不过,正如我在我的第一个问题说,我得到了它在VS2008工作,但VS2010不知道日外汇组装后我按下Build按钮。
But as I said in my first question I got it working in VS2008 but VS2010 doesn't know th Exchange assembly after I press the Build button.
推荐答案
答问题1:您需要从.NET框架4客户端配置文件切换目标框架项目只是:。NET Framework 4中。
Answer to Question 1: You need to switch the target framework in your project from ".NET Framework 4 Client Profile" to just:".NET Framework 4".
这篇关于Microsoft.Exchange.WebServices没有在VS2010工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!