Bsa.Exchange.WebServices 6.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bsa.Exchange.WebServices --version 6.0.1
                    
NuGet\Install-Package Bsa.Exchange.WebServices -Version 6.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bsa.Exchange.WebServices" Version="6.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bsa.Exchange.WebServices" Version="6.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Bsa.Exchange.WebServices" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bsa.Exchange.WebServices --version 6.0.1
                    
#r "nuget: Bsa.Exchange.WebServices, 6.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bsa.Exchange.WebServices@6.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bsa.Exchange.WebServices&version=6.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Bsa.Exchange.WebServices&version=6.0.1
                    
Install as a Cake Tool

Microsoft.Exchange.WebServices для .NET 6

Порт EWS Managed API 2.2 (исходники OfficeDev/ews-managed-api, коммит 25a393d, MIT) на .NET 6.

Публичный API не менялся: те же namespace Microsoft.Exchange.WebServices.Data, имя сборки Microsoft.Exchange.WebServices.dll и синхронные методы, что и в NuGet-пакете Microsoft.Exchange.WebServices 2.2.0. Код, написанный под старый пакет, переносится без правок.

Структура

Microsoft.Exchange.WebServices.sln
src/Microsoft.Exchange.WebServices/   — библиотека (net6.0)
samples/EwsSmokeTest/                 — консольная проверка: Inbox + последние 10 писем
artefacts/                            — отчёт о порте и patch относительно upstream
docs-upstream/                        — исходные лицензионные файлы Microsoft

Сборка

cd D:\Work\Microsoft.Exchange.WebServices
dotnet build -c Release
dotnet pack src\Microsoft.Exchange.WebServices -c Release -o artifacts\nuget

Нужен .NET SDK 6.0 или новее. С SDK 8/9 проект тоже собирается, будет только предупреждение об EOL net6.0, оно подавлено.

Проверка на сервере

cd samples\EwsSmokeTest
dotnet run -- --url https://mail.example.local/EWS/Exchange.asmx --user DOMAIN\user --password ***
dotnet run -- --url https://outlook.office365.com/EWS/Exchange.asmx --token <access_token> --mailbox user@example.com
dotnet run -- --autodiscover user@example.com --user user@example.com --password *** --trace

Что изменено относительно оригинала

Место Проблема на .NET 6 Решение
Security/*, EwsXmlReader, EwsServiceMultiResponseXmlReader ProhibitDtd удалён из .NET Core DtdProcessing = DtdProcessing.Prohibit
HangingServiceRequestBase System.Web.HttpException недоступен catch удалён (на .NET 6 это IOException/WebException, они уже обрабатываются)
SoapFaultDetails, SetUserPhoto* неиспользуемые using System.Web.Services.Protocols / System.Drawing удалены
GetUserPhotoResults.AsImage() System.Drawing работает только на Windows пакет System.Drawing.Common, метод помечен [SupportedOSPlatform("windows")]; кроссплатформенно используйте свойство Photo (byte[])
DirectoryHelper (Autodiscover через LDAP SCP) System.DirectoryServices только для Windows пакет System.DirectoryServices; на Linux/macOS шаг пропускается
AutodiscoverDnsClient (DNS SRV) P/Invoke в dnsapi.dll на Linux/macOS шаг пропускается, остальные способы Autodiscover работают
X509CertificateCredentials X509Certificate2.PrivateKey ненадёжен на .NET Core GetRSAPrivateKey()
BasicAuthModuleForUTF8 AuthenticationManager.Register на .NET Core ничего не делает пустая заглушка; HTTP-стек .NET сам кодирует Basic в UTF-8
MimeContent и др. Encoding.GetEncoding("windows-1251") по умолчанию недоступен Core/EncodingBootstrap.cs регистрирует CodePagesEncodingProvider при загрузке сборки
AssemblyInfoMicrosoft.cs InternalsVisibleTo на внутренние сборки Microsoft удалён
csproj старый формат, .NET Framework 3.5 SDK-style, net6.0

WCF и System.ServiceModel не нужны: EWS Managed API никогда их не использовал, SOAP формируется вручную через HttpWebRequest + XmlWriter.

Ограничения

  • В Exchange Online EWS отключается для тенантов с 1 октября 2026 г., полное отключение запланировано на 1 апреля 2027 г. Для Microsoft 365 нужен Microsoft Graph. На Exchange Server on-premises EWS продолжает работать.
  • Внутри по-прежнему используется HttpWebRequest. Он устарел (SYSLIB0014), но полностью работает в .NET 6–9, потому что реализован поверх HttpClient.
  • Сборка не подписана ключом Microsoft. Если старый код ссылался на strong name, пересоберите его с этой версией.
  • PackageId = Exchange.WebServices.Net6, потому что префикс Microsoft.* на nuget.org зарезервирован. Для приватного фида его можно поменять.
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 111 10/24/2026
9.0.1 90 10/24/2026
8.0.1 96 10/24/2026
7.0.1 100 10/24/2026
6.0.4 92 10/24/2026
6.0.3 116 10/24/2026
6.0.1 107 10/23/2026
6.0.0 97 10/23/2026
2.2.2 101 10/23/2026