diff --git a/.gitignore b/.gitignore
index 54cebc8e..8715ef5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -184,3 +184,8 @@ UpgradeLog*.htm
FakesAssemblies/
/project.lock.json
/.svn
+
+# VS for Mac
+mono_crash.*.json
+UserPrefs.xml
+project-cache/
diff --git a/ComplexProperties/FileAttachment.cs b/ComplexProperties/FileAttachment.cs
index ebf76341..cb3d726f 100644
--- a/ComplexProperties/FileAttachment.cs
+++ b/ComplexProperties/FileAttachment.cs
@@ -189,15 +189,17 @@ internal override void WriteElementsToXml(EwsServiceXmlWriter writer)
/// The stream to load the content of the attachment into.
public async System.Threading.Tasks.Task Load(Stream stream)
{
- this.loadToStream = stream;
-
+ // TODO: content/contentStream should be removed or should reference to underlying value
try
{
+ // 1) Load attachment from EWS
await this.Load();
+
+ // 2) Write content to stream
+ stream.Write(Content, 0, Content.Length);
}
finally
{
- this.loadToStream = null;
}
}
@@ -207,21 +209,19 @@ public async System.Threading.Tasks.Task Load(Stream stream)
/// The name of the file to load the content of the attachment into. If the file already exists, it is overwritten.
public async System.Threading.Tasks.Task Load(string fileName)
{
- this.loadToStream = new FileStream(fileName, FileMode.Create);
-
- try
- {
- await this.Load();
- }
- finally
- {
- this.loadToStream.Dispose();
- this.loadToStream = null;
- }
+ using(var fileStream = new FileStream(fileName, FileMode.Create))
+ try
+ {
+ // 1) Load attachment from EWS
+ await this.Load();
+
+ // 2) Write content to file
+ fileStream.Write(Content, 0, Content.Length);
+ }
+ finally
+ {
+ }
- this.fileName = fileName;
- this.content = null;
- this.contentStream = null;
}
///
diff --git a/Microsoft.Exchange.WebServices.NETStandard.csproj b/Microsoft.Exchange.WebServices.NETStandard.csproj
index 4cee8984..c744cf6f 100644
--- a/Microsoft.Exchange.WebServices.NETStandard.csproj
+++ b/Microsoft.Exchange.WebServices.NETStandard.csproj
@@ -1,62 +1,65 @@
-
- 2.0.0
- netstandard2.0;net461
- Microsoft.Exchange.WebServices.NETStandard
- Microsoft.Exchange.WebServices.NETStandard
- false
- false
- false
- false
- false
- false
- false
- true
- sherlock1982
- https://github.com/sherlock1982/ews-managed-api
- git
- ews exchange office365 Microsoft Web API Email Client Library C#
- https://github.com/sherlock1982/ews-managed-api
- Microsoft.Exchange.WebServices.NETStandard
- The Exchange Web Services (EWS) Managed API provides a managed interface for developing .NET client applications that use EWS. By using the EWS Managed API, you can access almost all the information stored in an Office 365, Exchange Online, or Exchange Server mailbox.
- removed obsolete WebRequests and switched to HttpClient internally
-fixed issue with file attachements downloads
-restored ldap autodiscover functionality
-merged changes from official Microsoft repository
-added cancellation token for most of methods
-
- 2.0.0-beta2
- license.txt
-
-
-
-
-
-
-
+
+ 2.0.0
+ netstandard2.0;net461
+ Microsoft.Exchange.WebServices.NETStandard
+ Microsoft.Exchange.WebServices.NETStandard
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ true
+ sherlock1982
+ https://github.com/sherlock1982/ews-managed-api
+ git
+ ews exchange office365 Microsoft Web API Email Client Library C#
+ https://github.com/sherlock1982/ews-managed-api
+ Microsoft.Exchange.WebServices.NETStandard
+ The Exchange Web Services (EWS) Managed API provides a managed interface for developing .NET client applications that use EWS. By using the EWS Managed API, you can access almost all the information stored in an Office 365, Exchange Online, or Exchange Server mailbox.
+ removed obsolete WebRequests and switched to HttpClient internally
+fixed issue with file attachements downloads
+restored ldap autodiscover functionality
+merged changes from official Microsoft repository
+added cancellation token for most of methods
+
+ 2.0.0-beta2
+ license.txt
+
+
+
+
+
+
+
-
-
- 4.7.0
-
+
+
+ 4.7.0
+
-
-
+
+
+
-
-
-
+
+
+ True
+
+
-
-
- True
-
-
+
+
+ True
+
+