Giter VIP home page Giter VIP logo

ews-managed-api's People

Contributors

annosz avatar ashishks1987 avatar davidchesnut avatar davster avatar dclaux avatar gitter-badger avatar helgesson avatar lanfeust69 avatar lassehoo avatar lauragra avatar michaelmainer avatar mikes-gh avatar mpdzik avatar orkunakca avatar pauldmendoza avatar poizan42 avatar rykoma avatar sherlock1982 avatar svrooij avatar vboctor avatar wgroenestein avatar yinaa avatar ysanghi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ews-managed-api's Issues

TimeZone issue

I'm having almost the same issue as this, but I need to set a default timezone for everything (finding, adding, deleting appointments). The solution in that issue doesn't seem to work when used like this:

var ewsService = new ExchangeService(ExchangeVersion.Exchange2016, TZConvert.GetTimeZoneInfo("Arabian Standard Time"));
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
     ewsService.TimeZoneDefinition.Id = TZConvert.IanaToWindows(ewsService.TimeZone.Id);

My web app is deployed on Linux

New lines are not retrieved in text e-mail body in 1.1.1

Scenario:

I have an e-mail service that retrieves an email and extracts some settings from a text (not HTML) email.
In terms of code it can be described as

messageBody.BodyType != BodyType.Text

I use the following code to extract the settings where

 string messageText = messageBody.Text;

Extraction logic is as follows:

var separator = new[] {Environment.NewLine};

IReadOnlyCollection<string> settingLines = messageText
                .Split(separator, StringSplitOptions.None)
                .SkipUntil(line => line == "--- START_CONFIG ---")
                .TakeWhile(line => line != "--- END_CONFIG ---").ToList();

Expected result:

messageText has newline characters in it and settingLines extracted as expected

Actual result in 1.1.0

messageText has newline characters in it and settingLines extracted as expected

Actual result in 1.1.1

messageText does not have newline characters in it and settingLines is null.

Additional info:

System:
Edition: Windows 10 Pro
Version 1709
OS Build 16299.19

Project target framework .Net 4.6.1

To aid in debugging here's the example body of my e-mail:

--- START_CONFIG ---
setting1: Some Value1
setting2: Some Value2
setting3: 123
--- END_CONFIG ---

Some other irrelevant content
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

In 1.1.1 I get the following text back

--- START_CONFIG ---setting1: Some Value1setting2: Some Value2setting3: 123--- END_CONFIG ---Some other irrelevant content______________________________________________________________________This email has been scanned by the Symantec Email Security.cloud service.For more information please visit http://www.symanteccloud.com______________________________________________________________________

Using basic authentication

Hello!

For system architecture related reasons I need to use basic authentication with EWS. EWS has basic authentication enabled and it works with SoapUI. How can the managed api client be configured to use basic authentication instead of NTLM?

Regards,
Aleksander

Net Core 2.0.0 support?

What do you think about a netcore 2.0.0 version using new project system.
You don't need VS 2017 as vscode and dotnet migrate are sufficient to build.
I haven't tried 2.0.0 yet but will be moving quite soon after RTM as the API surface is dramatically increased.
Will probably be able to enable some more features on Linux.

EWS on MacOS and Linux 401 Unauthorized error!

I need to connect to EWS. I am using Microsoft.Exchange.WebServices NuGet package for that. On the Windows machine everything is ok, but on Mac OS I'm getting the error "The remote server returned an error: (401) Unauthorized." Also, if I use just Microsoft.Exchange.WebServices it works fine, but whole my project is based on .Net Core. Maybe, somebody has encountered this problem.
Also I tried Microsoft.Exchange.WebServices.NETStandard/2.0.0-beta1 nuget, but still have error with Unautorized!

Creating too many connections to the Exchange Server

I am implementing a .NET application with the EWS Managed API and have decided to port it to .NET Core. I've learned that the official Microsoft EWS Managed API library doesn't currently support .NET Core and found this fork, which does.

Unfortunately, while testing my application with Microsoft.Exchange.WebServices.NETStandard.dll, I noticed that it would start failing with "Connection with the server could not be established" errors after running for less than few mins. (There are no problems with the official Microsoft.Exchange.WebServices.dll under .NET Framework, though). Further investigation revealed that the application was creating a lot of network connections and leaving many of them in TIME_WAIT state. Using .NET Core 2.0 or 2.1 as the target framework didn't make a difference.

Looking at EWS Managed API source code and reading various StackOverflow posts, it turns out that this is actually .NET Core to blame. Microsoft.Exchange.WebServices.NETStandard.dll is still using old HttpWebRequest and HttpWebResponse classes, which are NOT reusing network connections in .NET Core as they would do in .NET Framework. It is sad to see that Microsoft doesn't plan to fix this issue (https://github.com/dotnet/corefx/issues/26373) and recommends to move to HttpClient.

Because of this problem, Microsoft.Exchange.WebServices.NETStandard.dll is not really suitable for applications working with lots of user mailboxes and/or items. It will practically cause DDoS attack against Exchange Server.

It seems that Microsoft.Exchange.WebServices.NETStandard.dll is already using HttpClient in Autodiscovery, but the core logic is still implemented with HttpWebRequest and HttpWebResponse classes. How difficult would it be to scrape HttpWebRequest/HttpWebResponse off entirely and switch to HttpClient?

Unable to save new appointment

Hi Nikolai!

I've tried to save new appointment (nothing special, just creating new appointment with few fields like Subject/Location/Start/End/Attendees) and got a lot of exceptions (please check screenshots below).

        Appointment meeting = new Appointment(service);

        meeting.Subject = "Subject";
        meeting.Body = "Body";
        meeting.Start = DateTime.Now.AddHours(2);
        meeting.End = DateTime.Now.AddHours(4);
        meeting.Location = "Location";
        meeting.RequiredAttendees.Add("[email protected]");
        meeting.ReminderMinutesBeforeStart = 30;

        meeting.Save(SendInvitationsMode.SendToNone); 

I've tried to investigate the issue but didn't find any solutions to fixing that on saving (not on retrieving).
Also I've checked code from MSDN and it's exactly the same...

Could you please point out what I'm doing wrong? Or it is known issue?

Thanks!

2017-07-25 15_26_00-consoleapp3 debugging - microsoft visual studio

No response from on-prem exchange using Raspberry Pi

No response from Exchange Server after initial StreamingSubscriptionRequest. Using Debian and .net core 3.0 preview 5. I know the Pi can reach the server, as they can ping each other. Maybe there is a bug/unimplemented feature I'm not aware of on linux?

Update the Repo

Before I do a PR I would like to know if this project is still maintained.
At the moment it is the only viable alternative to net core with ews.

A couple of things I would like to add.

  1. Move to new project system VS 2017.
  2. Fix #2

Autodiscover Error in Windows UWP app

Hello, The UWP package we own throws this exception (below).
The call to DnsNativeMethods.FreeDnsQueryResults(queryResultsPtr); is called without a try catch around it and this stops further processing of auto discovery.

 0x80131522 System.TypeLoadException: Unresolved P/Invoke method 'dnsapi.dll!DnsRecordListFree' from this method. Please look for this method in build warnings for more details. 

	 at Microsoft.Exchange.WebServices.Dns.DnsNativeMethods.DnsRecordListFree(IntPtr, DnsNativeMethods.FreeType) + 0x2d
	 at Microsoft.Exchange.WebServices.Dns.DnsNativeMethods.FreeDnsQueryResults(IntPtr) + 0x8
	 at Microsoft.Exchange.WebServices.Dns.DnsClient.DnsQuery[T](String, IPAddress) + 0x2c0
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverDnsClient.FindBestMatchingSrvRecord(String) + 0x8d
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverDnsClient.FindAutodiscoverHostFromSrv(String) + 0x24
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetRedirectionUrlFromDnsSrvRecord(String) + 0x3a
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetSettings[TGetSettingsResponseCollection, TSettingName](List`1, List`1, Nullable`1, AutodiscoverService.GetSettingsMethod`2, Func`1) + 0x381
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(List`1, List`1) + 0xcb
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.InternalGetSoapUserSettings(String, List`1) + 0x12a
	 at Microsoft.Exchange.WebServices.Autodiscover.AutodiscoverService.GetUserSettings(String, UserSettingName[]) + 0x5a
	 at Microsoft.Exchange.WebServices.Data.ExchangeService.GetAutodiscoverUrl(String, ExchangeVersion, AutodiscoverRedirectionUrlValidationCallback) + 0x87
	 at Microsoft.Exchange.WebServices.Data.ExchangeService.AutodiscoverUrl(String, AutodiscoverRedirectionUrlValidationCallback) + 0x34

TimeZone trouble

Could you guys make the Id of TimeZoneDefinition overridable? And TimeZoneDefinition public?

Why I'm asking: Normally you could set the TimeZone of appointments with this property. By setting the correct timezone while creating the ExchangeService, but on Unix the TimeZoneIds are different then the ones Exchange is expecting.

Unix: Europe/Amsterdam
Windows (and Exchange): W. Europe Standard Time

If you would know what you're doing this smallllll change would solve a lot of TimeZone trouble for this project, which is really great by the way!!!

Ubuntu - trouble with TimeZoneTransitionGroup

After authenticating with EWS on Ubuntu - i can now read appointments and mails - however - i'm unable to save new Appointments due to a strange error related to TimeZones.

Executing the following code:

/// <summary>	Adds an appointment. </summary>
		/// <param name="appointment">	The appointment. </param>
		public async Task<EwsAppointment> AddAppointment(EwsAppointment appointment)
		{
			if (_options.DeleteMails)
				await DeleteOldMails();

			var folder = await GetFolder(_options.TargetFolder);
			var apt = new Appointment(_service)
			{
				Subject = appointment.Subject,
				Body = appointment.Body,
				Start = appointment.Start,
				End = appointment.End,
				Location = appointment.Location,
				IsAllDayEvent = appointment.IsAllDay
			};

			foreach (var attendee in appointment.Attendees)
				apt.RequiredAttendees.Add(attendee);

			await apt.Save(folder, SendInvitationsMode.SendToNone);
			return appointment;
		}

throws an ArgumentException that seems to be raised whenever the class "ExchangeServiceBase" get's is TimeZoneDefinition.

The Stracktrace is as follows:

2017-11-10 12:48:49.810 +01:00 [Error] Unhandled exception
System.ArgumentException: An item with the same key has already been added. Key: Dlt/1916
at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Microsoft.Exchange.WebServices.Data.TimeZoneTransitionGroup.InitializeFromAdjustmentRule(AdjustmentRule adjustmentRule, TimeZonePeriod standardPeriod)
at Microsoft.Exchange.WebServices.Data.TimeZoneDefinition..ctor(TimeZoneInfo timeZoneInfo)
at Microsoft.Exchange.WebServices.Data.ExchangeServiceBase.get_TimeZoneDefinition()
at FluiTech.CallRouting.Ews.EwsHelper..ctor(EwsOptions options) in C:\dev\BitBucket\FluiTec\CallRouting\src\FluiTech.CallRouting.Ews\EwsHelper.cs:line 59
--- End of stack trace from previous location where exception was thrown ---

So - something tries to add the id "Dlt/1916" although it's already there.

Again - this happens only for Linux/Ubuntu.

The Exchange-Server i'm using is Exchange2013, if relevant - TimeZone of the linux-server is CET/CEST.

I already found the issue "Trouble with TimeZones" and tried using TimeZoneConverter using the given code:

if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
		        _service.TimeZoneDefinition.Id = TZConvert.IanaToWindows(_service.TimeZone.Id);

Sadly - this only raises the above mentioned exception earlier for me.

Attachments Download

Hi everybody
Is any problem with download attachments in .net core 2?
I trying to download the attachments but when they save, they have 0 size.
can you help me?

Thanks in advance
this is my code

FindItemsResults Results = _service.FindItems(WellKnownFolderName.Inbox, new ItemView(1)).Result;
foreach (Item item in Results.Items)
{
EmailMessage msg = EmailMessage.Bind(_service, item.Id, new PropertySet(BasePropertySet.FirstClassProperties)).Result;

            if (msg.IsRead == false)
                model.Add(new ExchangeMailTemplateModel
                {
                    Subject = msg.Subject,
                });


            msg.Load(new PropertySet(EmailMessageSchema.Attachments));
            if (msg.HasAttachments)
            {
                foreach (var attachment in msg.Attachments)
                {
                    if (attachment is FileAttachment)
                    {
                        FileAttachment fileAttachment = attachment as FileAttachment;
                        fileAttachment.Load();

                        fileAttachment.Load("C:\\temp\\" + fileAttachment.Name);
                        using (FileStream theStream = new FileStream("C:\\temp\\Stream_" + fileAttachment.Name, FileMode.OpenOrCreate, FileAccess.ReadWrite))
                        {
                            fileAttachment.Load(theStream);
                        }
                        Console.WriteLine("FileName: " + fileAttachment.FileName);
                    }
                    else
                    {
                        ItemAttachment itemAttachment = attachment as ItemAttachment;
                        itemAttachment.Load(ItemSchema.MimeContent);
                        string fileName = "C:\\Temp\\" + itemAttachment.Item.Subject + ".eml";
                        // Write the bytes of the attachment into a file.
                        File.WriteAllBytes(fileName, itemAttachment.Item.MimeContent.Content);
                        Console.WriteLine("Email attachment name: " + itemAttachment.Item.Subject + ".eml");
                    }
                }
            }
        }

Appointment.Update methods awaitable

Hi,

Great job so far - thanks!

Can you make all the Update methods on the Appointment object awaitable?

Appointment.Update(ConflictResolutionMode, Boolean) - awaitable
Appointment.Update(ConflictResolutionMode) - not awaitable
Appointment.Update(ConflictResolutionMode, SendInvitationsOrCancellationsMode) - not awaitable

Thanks,

Scott

Empty Attachment Content Size in Version 1.1.1

We have a Problem with the ews-managed-api.

If we use the GetAttachments Function the Size and the Content of the Attachment ist empty.

var exchangeResponse = ExchangeService.GetAttachments(new[] { attachmentId }, null, PropSet); var ewsAttachmentResponse = exchangeResponse.Result.First(); var ewsAttachment = ewsAttachmentResponse.Attachment;

How can I Load the Content and Size for an MemoryStream?

A strongly-named assembly is required

Hi,

the .NET framework 4.6.1 Windows Form application returns this error:
A strongly-named assembly is required.

Nuget package dependencies says: .NETFramework,Version=v4.6

What am I doing wrong?
Thanks in advance

File Attachment 0 bytes

Having problem when retrieving the attachment, getting 0 bytes.
Below is the code snippet,

foreach (Item item in _findResults)
                {                  
                    EmailMessage message = EmailMessage.Bind(serviceInstance, item.Id, new PropertySet(BasePropertySet.IdOnly, ItemSchema.Attachments)).Result;
                    foreach (Attachment _attachment in message.Attachments)
                    {
                        if (_attachment is FileAttachment)
                        {
                            FileAttachment fileAttachment = _attachment as FileAttachment;
                            fileAttachment.Load();
                            byte[] result;

                            using (var streamReader = new MemoryStream())
                            {
                                fileAttachment.Load(streamReader);
                                streamReader.Seek(0, SeekOrigin.Begin);
                                result = streamReader.ToArray();
                            }

                        }
                    }                  
                }

Methods not accepting CancellationToken

Hello!
Great job you have done here! Unfortunately, none of the methods is accepting CancellationToken parameter (has no overload accepting such parameter) whilst this is almost standard in the async approach. I know that these operations last quite short, thus this is not a blocking condition, but it would be a great feature to add... Do you have such intention?

GSSAPI error when using Impersonation on Linux

Using Impersonation on Linux I am getting the following error when Binding to a folder.
System.ComponentModel.Win32Exception (0x80090020): GSSAPI operation failed with error - An invalid status code was supplied (Unknown error).

Relevant Code:

// Setup Credentials
var es = new ExchangeService(ExchangeVersion.Exchange2013_SP1)
                {
                    Url = new Uri(settings.Value.Server),
                    Credentials = new WebCredentials(settings.Value.User, settings.Value.Pass)
                };

Then Later making the call

es = ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, mailbox);
var mb = new Mailbox(mailbox);
var fid = new FolderId(WellKnownFolderName.Inbox, mb);
var folder = await Folder.Bind(es, fid);

Running on: PCF Buildpack: dotnet_core_edge 2.1
Stack: cflinuxfs2 (Cloud Foundry Linux-based filesystem)

GetUserAvailability throws NotImplementedException

I'm trying to get the availablility for a room by calling GetUserAvailability, but it throws a NotImplementedException exception.

List<AttendeeInfo> RoomInfo = new List<AttendeeInfo>() { new AttendeeInfo(Rooms[0].Address) };
var result = await Service.GetUserAvailability(RoomInfo, new TimeWindow(DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1)), AvailabilityData.FreeBusy)

It seems to be independent of the email address, used for the AttenddeeInfo.
I tryied Nuget package verison 1.0.12 and 1.0.4, as well as targeting different .net core framework version without any success.
Other methods like FindAppointments work without any problems.

Can some give me an advise to resolve this issues?
Very many thanks in advance.

The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure

Hello

Installed the Microsoft.Exchange.WebServices.NETStandard 1.1.3 package via nuget, the letter via the Exchange service is successfully sent via the Windows OS
Under Linux, Debian no longer works.

I had to download the weight of the project source and connect it to the project. In this case, sending does not work under Windows and under Linux.

I use a component under Debian to connect to Exchang server. Debian in docker. I use Core 2.2
Sending an email.

public void Send(MailMessage mailMessage)
{
	var service = GetService();

	if (service != null)
	{
		EmailMessage emailMessage = new EmailMessage(service)
		{
			From = new EmailAddress(ewsConnection.MailBox),
			Subject = mailMessage.Subject,
			Body = mailMessage.Body,
		};

		if (mailMessage.Adresses != null)
		{
			foreach (var email in mailMessage.Adresses)
			{
				emailMessage.ToRecipients.Add(new EmailAddress(email));
			}
		}

		emailMessage.Send();
	}
}

private ExchangeService GetService()
{
	ExchangeService service = null;
	ExchangeVersion version;
	if (Enum.TryParse<ExchangeVersion>(ewsConnection.Version, out version))
	{
		service = new ExchangeService(version);

		service.Credentials = new WebCredentials(ewsConnection.Login, ewsConnection.Password);
		service.Url = new Uri(ewsConnection.Host);

		// Проверка сертификата 
		ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
	}

	return service;
}

Submit Error:

The SSL connection could not be established, see inner exception. The remote certificate is invalid according to the validation procedure.

What can I do?

Issue running on Ubuntu 14.04 with .net core 2.1

It looks like with the new socket changes in .Net core 2.1 the HttpWebRequest and HttpWebResponse are no longer supported on Unix. As i get the following error: No support for channel binding on operating systems other than Windows.
Are there any plans to move all requests/responses to use the HttpClient? At the moment I've worked around this be adding the following to my code: AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false); which set it back to the 2.0 implementation.

Thanks.

Ews Api in Console App

Does anyone have use it in a net core console app?

It works perfectly in Asp.Net Core but I'm not able to get successfully Discovery or Exchange response, running same code in Console App.

I'm following exactly same 101 sample from Microsoft Docs.

FindItems giving error

Hi Guys,

I have the below code in my controller but I am getting an error at service.FindItems:
Cannot implicitly convert type 'System.Threading.Tasks.Task<Microsoft.Exchange.WebServices.Data.FindItemsResults<Microsoft.Exchange.WebServices.Data.Item>>' to 'Microsoft.Exchange.WebServices.Data.FindItemsResults<Microsoft.Exchange.WebServices.Data.Item>'

Code:

        public IActionResult GetEmail(string email)
        {
            ExchangeService service = new ExchangeService();
            service.UseDefaultCredentials = false;
            service.Credentials = new System.Net.NetworkCredential("myname", "mypassword");
            service.AutodiscoverUrl("myemail");

            ItemView view = new ItemView(20);
            view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Descending);
            PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.DateTimeReceived, ItemSchema.Subject, ItemSchema.HasAttachments, ItemSchema.Importance, ItemSchema.Body);
            propSet.RequestedBodyType = BodyType.Text;
            var queryInboxstring = string.Format("(From:={0})", email);
            FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, queryInboxstring, view);

            return Ok(findResults);

        }

Could anyone help me out as to why or what I can do to fix this error?

[Feature?] Missing AppIdentityToken from WebServices.Auth

I was hoping to use the package to perform the AppIdentityToken routine provided at https://docs.microsoft.com/en-us/outlook/add-ins/validate-an-identity-token [code shown below] but I can't seem to find the "Auth" namespaces.

using Microsoft.Exchange.WebServices.Auth.Validation;

AppIdentityToken ValidateIdentityToken(string rawToken, string expectedAudience)
{
    try
    {
        AppIdentityToken appIdToken = AuthToken.Parse(rawToken) as AppIdentityToken;
        appIdToken.Validate(new Uri(expectedAudience));

        // No exception, validation succeeded
        return appIdToken;
    }
    catch (TokenValidationException ex)
    {
        throw new Exception(string.Format("Token validation failed: {0}", ex.Message));
    }
}

I'm hoping you'll tell me I'm being blind! If it's not implemented is there any plan to implement? I've got a API that's pretty much complete and have been asked to add basic Outlook Web Plugin calls to it but the whole thing is written in .Net Core.

Content Type issue

Hi Guys,

I'm having some issue when I tried to use this version with relates to the content type.
Is there anyone has the same issue? Your help is very much appreciated. Thanks!

`Inner Exception 1:
ServiceRequestException: The request failed. Cannot process the message because the content type 'text/plain; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.

Inner Exception 2:
EwsHttpClientException: Cannot process the message because the content type 'text/plain; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.`

Downloading attachments using sample code

Hi! Not sure if theres a bug with the Load method; but the following code appears to write a 0 byte file to disk

                // Read 100 mails
                foreach (var email in service.FindItems(WellKnownFolderName.Inbox, new ItemView(100)).Result)
                {
                    if (email.HasAttachments)
                    {
                        var attachmentMessage = EmailMessage.Bind(service, email.Id, new PropertySet(ItemSchema.Attachments)).Result;

                        foreach (var attachment in attachmentMessage.Attachments)
                        {
                            string name = null;

                            if (attachment is FileAttachment)
                            {
                                FileAttachment fileAttachment = attachment as FileAttachment;
                                // Load the attachment into a file.
                                // This call results in a GetAttachment call to EWS.
                                fileAttachment.Load();

                                name = fileAttachment.Name;
                                fileAttachment.Load("C:\\Temp\\" + name);

                                Debug.WriteLine("File attachment name: " + name);
                            }
                            else // Attachment is an item attachment.
                            {
                                ItemAttachment itemAttachment = attachment as ItemAttachment;
                                // Load attachment into memory and write out the subject.
                                // This does not save the file like it does with a file attachment.
                                // This call results in a GetAttachment call to EWS.
                                itemAttachment.Load();

                                Debug.WriteLine("Item attachment name: " + itemAttachment.Name);
                            }
                        }
                    }

                    Debug.WriteLine("Subject: " + email.Subject);
                }

The project I've used for reference is located here:
https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633665(v%3Dexchg.80)

Thanks for your time!

(401) Anonymous Request Disallowed on Ubuntu 14

Hi,

first about the project i'm currently migrating:
Small AspNetCore-application previously hosted on Windows (outside of the domain) that shall be migrated to an Ubuntu-Server (obviously outside of the domain).

Using ews-managed-api in version 1.0.15 - i'm getting the ServiceRequestException with "(401) Anonymous Request Disallowed" - although i'm specifying:
Domain, User and Password

Is there any known problem on linux about this? Would an upgrade to version 1.1 help here?

The code i'm using to authenticate is:
_service = new ExchangeService(_options.Version) { Url = new Uri(_options.ServiceUrl), Credentials = new WebCredentials(_options.Username, _options.Password, _options.Domain), PreAuthenticate = true };
(The options i'm specifying match the ones i've given the windows-server. Domain is specified like 'mydomain.local')

I'd be happy about a little feedback :)

Stacktrace:
Microsoft.Exchange.WebServices.Data.ServiceRequestException: The request failed. The remote server returned an error: (401) Anonymous Request Disallowed. ---> System.Net.WebException: The remote server returned an error: (401) Anonymous Request Disallowed. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebRequest.<>c.b__37_2(IAsyncResult iar) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.EwsHttpWebRequest.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.d__45.MoveNext() --- End of inner exception stack trace --- at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.d__45.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.d__43.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest1.d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.ExchangeService.d__24.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Exchange.WebServices.Data.ExchangeService.d__251.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at FluiTech.CallRouting.Ews.EwsHelper.d__8.MoveNext() in C:\dev\BitBucket\FluiTec\CallRouting\src\FluiTech.CallRouting.Ews\EwsHelper.cs:line 78 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at FluiTech.CallRouting.Ews.EwsHelper.d__9.MoveNext() in C:\dev\BitBucket\FluiTec\CallRouting\src\FluiTech.CallRouting.Ews\EwsHelper.cs:line 92 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at FluiTech.CallRouting.AspCoreHost.Controllers.ApiControllers.CalendarController.d__4.MoveNext() in C:\dev\BitBucket\FluiTec\CallRouting\src\FluiTech.CallRouting.AspCoreHost\Controllers\ApiControllers\CalendarController.cs:line 67 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ObjectMethodExecutor.d__381.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__25.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__22.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ResourceExecutedContext context) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__20.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting.IdentityServerMiddleware.d__4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting.FederatedSignOutMiddleware.d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting.AuthenticationMiddleware.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at IdentityServer4.Hosting.BaseUrlMiddleware.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware1.d__18.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.d__6.MoveNext()
`

DNS Autodiscover on Linux is not working

The last algorithm for Autodiscover is made with DNS Autodiscover. On Linux it fails with a message "Unable to load DLL 'dnsapi.dll". For now it should be treated as "Autodiscover failed".

Need to find a way to do DNS Autodiscover on Linux or just don't call it at all.

Authentication problem

This is my code
//ExchangeVersion.Exchange2007_SP1 为要对应Exchange的版本
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2016);
// 用户名 密码
service.Credentials = new WebCredentials(@"suz_packinglist", "Tfme@12345");
service.UseDefaultCredentials = true;
service.TraceFlags = TraceFlags.All;
service.TraceEnabled = true;
//自动发现服务查找您的 EWS 终结点。,并赋值给ExchangeService对象的URL属性
service.AutodiscoverUrl("[email protected]", RedirectionUrlValidationCallback);
Console.WriteLine("========service.Url=======");
Console.WriteLine(service.Url);
EmailMessage email = new EmailMessage(service);
//收件人
email.ToRecipients.Add("[email protected]");
//标题
email.Subject = "HelloWorld";
//正文
email.Body = new MessageBody("This is the first email I've sent by using the EWS Managed API");
//发送邮件
email.Send();

Console.WriteLine(service.Url);
The execution result is""
[email protected] did not receive the sent email

Autodiscovery fail: Call to dnsapi.dll on Linux

ews-managed-api tries to lookup the _autodiscover._tcp URL from the dns server like
nslookup -type=srv _autodiscover._tcp.my_domain.local
which is fine, except it makes calls to dnsapi.dll on Linux !
Self-evidently, that fails.

Microsoft.Exchange.WebServices.Dns
internal static class DnsNativeMethods
  {

    [DllImport("dnsapi.dll", EntryPoint = "DnsQuery_W", CharSet = CharSet.Unicode, SetLastError = true)]
    private static extern int DnsQuery([In] string pszName, DnsRecordType wType, DnsNativeMethods.DnsQueryOptions options, IntPtr aipServers, ref IntPtr ppQueryResults, int pReserved);

    [DllImport("dnsapi.dll", CharSet = CharSet.Unicode)]
    private static extern void DnsRecordListFree([In] IntPtr ptrRecords, [In] DnsNativeMethods.FreeType freeType);

The solution would be to do this with ArSoft (.NET Core DNS library).

using ARSoft.Tools.Net;
using ARSoft.Tools.Net.Dns;

public static void Test4()
{
    System.Net.NetworkInformation.IPGlobalProperties ipgp = 
        System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties();

    // IDnsResolver resolver = new RecursiveDnsResolver(); // Warning: Doesn't work
    IDnsResolver resolver = new DnsStubResolver();

    // List<SrvRecord> srvRecords = resolver.Resolve<SrvRecord>("_ldap._tcp." + ipgp.DomainName, RecordType.Srv);
    List<SrvRecord> srvRecords = resolver.Resolve<SrvRecord>("_autodiscover._tcp." + ipgp.DomainName, RecordType.Srv);


    foreach (SrvRecord thisRecord in srvRecords)
    {
        // System.Console.WriteLine(thisRecord.Name);
        System.Console.WriteLine(thisRecord.Target);
        System.Console.WriteLine(thisRecord.Port);

        // Note: OR LDAPS:// - but Novell doesn't want these parts anyway 
        string url = "LDAP://" + thisRecord.Target + ":" + thisRecord.Port; 
        System.Console.WriteLine(url);
    } // Next thisRecord

}

AutodiscoverUrl error

Hi,

I'm migrating a project from .NET Framwork to Core and am now using this package

Should this code work?

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1) { UseDefaultCredentials = true, ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, emailAddress) }; service.AutodiscoverUrl(emailAddress);

I just get an error "The Autodiscover service couldn't be located."

The same code work in the .NET Framework version using the MS EWS API

Strong naming?

First of all, thanks for your work! You did what Microsoft should have done in the first place :-)

Would it be possible to strong name the assembly? It would silence a compilation warning:

6>CSC : warning CS8002: Referenced assembly 'Microsoft.Exchange.WebServices.NETStandard, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.

Appointment non awaitable methods that call server not working?

Hi,

Thank you for your quick response to my previous issue.

From my testing using the Appointment class it would seem that any non awaitable method that calls the server does not provide a response nor does it error.

The latest method I am having trouble getting a response from is Appointment.Forward. Are you able to make this method awaitable? (There may be others).

Thanks,

Scott

Unable to use EWS api

I am migrating a dotnet project that uses Microsoft.Exchange.WebServices.Data to connect Exchange server to process email to a .Net Core project (C# console app).
I added the nuget package Microsoft.Exchange.WebServices.NetStandard (Link). the following is the log
D:\learn\EmailToTfs>dotnet add package Microsoft.Exchange.WebServices.NETStandard --version 2.0.0-beta1
Writing C:\Users\M1036699\AppData\Local\Temp\tmp484B.tmp
info : Adding PackageReference for package 'Microsoft.Exchange.WebServices.NETStandard' into project 'D:\learn\EmailToTfs\EmailToTfs.csproj'.
log : Restoring packages for D:\learn\EmailToTfs\EmailToTfs.csproj...
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.exchange.webservices.netstandard/index.json
info : GET https://api.nuget.org/v3-flatcontainer/system.text.regularexpressions/index.json
info : GET https://api.nuget.org/v3-flatcontainer/system.net.http/index.json
info : OK https://api.nuget.org/v3-flatcontainer/microsoft.exchange.webservices.netstandard/index.json 1057ms
info : GET https://api.nuget.org/v3-flatcontainer/microsoft.exchange.webservices.netstandard/2.0.0-beta1/microsoft.exchange.webservices.netstandard.2.0.0-beta1.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/system.net.http/index.json 1160ms
info : OK https://api.nuget.org/v3-flatcontainer/system.text.regularexpressions/index.json 1181ms
info : OK https://api.nuget.org/v3-flatcontainer/microsoft.exchange.webservices.netstandard/2.0.0-beta1/microsoft.exchange.webservices.netstandard.2.0.0-beta1.nupkg 1087ms
info : GET https://api.nuget.org/v3-flatcontainer/system.net.http/4.3.3/system.net.http.4.3.3.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/system.net.http/4.3.3/system.net.http.4.3.3.nupkg 1066ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.native.system.security.cryptography.openssl/index.json
info : OK https://api.nuget.org/v3-flatcontainer/runtime.native.system.security.cryptography.openssl/index.json 1066ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.native.system.security.cryptography.openssl/4.3.2/runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.native.system.security.cryptography.openssl/4.3.2/runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1055ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/index.json
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/index.json
info : OK https://api.nuget.org/v3-flatcontainer/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/index.json 392ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/index.json 1084ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/index.json 1098ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/index.json 1092ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : GET https://api.nuget.org/v3-flatcontainer/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : GET https://api.nuget.org/v3-flatcontainer/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/index.json 1135ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/index.json 1134ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/index.json 1171ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/index.json 1154ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/index.json 1169ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/index.json 1151ms
info : GET https://api.nuget.org/v3-flatcontainer/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : GET https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg
info : OK https://api.nuget.org/v3-flatcontainer/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1064ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1129ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1151ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1132ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1141ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1205ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1194ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1266ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1385ms
info : OK https://api.nuget.org/v3-flatcontainer/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.2/runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.2.nupkg 1389ms
log : Installing runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing runtime.native.System.Security.Cryptography.OpenSsl 4.3.2.
log : Installing System.Net.Http 4.3.3.
log : Installing Microsoft.Exchange.WebServices.NETStandard 2.0.0-beta1.
warn : Microsoft.IdentityModel.Clients.ActiveDirectory 3.13.5 depends on System.Net.Http (>= 4.0.1) but System.Net.Http 4.0.1 was not found. An approximate best match of System.Net.Http 4.1.0 was resolved.
warn : Microsoft.IdentityModel.Clients.ActiveDirectory 3.13.5 depends on System.Text.RegularExpressions (>= 4.0.12) but System.Text.RegularExpressions 4.0.12 was not found. An approximate best match of System.Text.RegularExpressions 4.1.0 was resolved.
warn : Package 'Microsoft.AspNet.WebApi.Client 5.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
warn : Package 'Microsoft.AspNet.WebApi.Core 5.2.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
warn : Package 'Microsoft.Bcl 1.1.9' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
warn : Package 'Microsoft.Net.Http 2.2.22' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
warn : Package 'System.IdentityModel.Tokens.Jwt 4.0.2.206221351' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project.
info : Package 'Microsoft.Exchange.WebServices.NETStandard' is compatible with all the specified frameworks in project 'D:\learn\EmailToTfs\EmailToTfs.csproj'.
info : PackageReference for package 'Microsoft.Exchange.WebServices.NETStandard' version '2.0.0-beta1' added to file 'D:\learn\EmailToTfs\EmailToTfs.csproj'.

However, when I add the refrerence to the class by using "Using Microsoft.Exchange....", i do not see the Package in the intellisense and Compiler throw errors due to reference issues. Following image shows the issue.
The CS project definition
csproject
The MailManager Class where i am trying to use the EWS API.
mailmanager

I am not sure how to reference the EWS Api and connect the exchange server. Need Help on this

Can you create a library with a different name and a different space name?

Николай так получилось что в моём приложении используется уже это же пространство имен. Можете ли вы собрать для меня отдельную ветку например в название добавив IT

Appointment creation 'stuck'

Hi,

When I'm creating a new appointment, it doesn't show up in my calendar. Not after refresh or logout/login.

When I retry to add the appointment it goes through including the previous attempt, resulting in a double appointment.

Hope you can help me with this.

Unable to download FileAttachment

Hello!
I'm having a hard time downloading attachments.

The below code never downloads an attachment:

        private Dictionary<string, Stream> DownloadAttachments(EmailMessage message)
        {
            var result = new Dictionary<string, Stream>();

            var pdfAttachments = message.Attachments.Where(a => a.ContentType.Equals("application/pdf", StringComparison.OrdinalIgnoreCase));

            Log.Debug($"{pdfAttachments.Count()} attachment(s) found.");

            foreach (FileAttachment attachment in pdfAttachments)
            {
                var ms = new MemoryStream(attachment.Size);
                attachment.Load(ms);
                result.Add(attachment.Name, ms);
            }

            return result;
        }

No error is thrown; the attachment.Content property is null, and the length of the MemoryStream is 0. The metadata for the attachment is downloaded correctly though. I can obtain attachment filename, size, and content type.
Please note, that the EmailMessage message argument is already bound to an ExchangeService by the calling method using the ItemSchema.Attachments amongst other schemas.

Any help/insights would be greatly appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.