CryptoPro / corefx

This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.
https://github.com/dotnet/core
MIT License
27 stars 8 forks source link

Сборка не работает на Windows Server + IIS #54

Open IverCold opened 2 years ago

IverCold commented 2 years ago

Добрый день! Пытаюсь запустить WebAPI c CoreFx на Windows Server 2012R2 + IIS. Возникает вот такая ошибка:

System.MissingMethodException: Method not found: 'System.Security.Cryptography.HashAlgorithmName System.Security.Cryptography.HashAlgorithmName.get_Gost3411_2012_256()'.\r\n 
  at Internal.Cryptography.PkcsHelpers.GetDigestAlgorithm(String oidValue, Boolean forVerification)\r\n   at System.Security.Cryptography.Pkcs.SignerInfo.GetDigestAlgorithm() in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignerInfo.cs:line 737\r\n  
 at System.Security.Cryptography.Pkcs.SignerInfo.PrepareDigest(Boolean compatMode) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignerInfo.cs:line 510\r\n 
  at System.Security.Cryptography.Pkcs.SignerInfo.VerifySignature(CmsSignature signatureProcessor, X509Certificate2 certificate, Boolean compatMode) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignerInfo.cs:line 698\r\n  
 at System.Security.Cryptography.Pkcs.SignerInfo.Verify(X509Certificate2Collection extraStore, X509Certificate2 certificate, Boolean verifySignatureOnly) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignerInfo.cs:line 647\r\n
  at System.Security.Cryptography.Pkcs.SignerInfo.CheckSignature(X509Certificate2Collection extraStore, Boolean verifySignatureOnly) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignerInfo.cs:line 415\r\n 
  at System.Security.Cryptography.Pkcs.SignedCms.CheckSignatures(SignerInfoCollection signers, X509Certificate2Collection extraStore, Boolean verifySignatureOnly) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignedCms.cs:line 595\r\n 
  at System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(X509Certificate2Collection extraStore, Boolean verifySignatureOnly) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignedCms.cs:line 578\r\n  
 at System.Security.Cryptography.Pkcs.SignedCms.CheckSignature(Boolean verifySignatureOnly) in C:\\projects\\corefx\\src\\System.Security.Cryptography.Pkcs\\src\\System\\Security\\Cryptography\\Pkcs\\SignedCms.cs:line 569\r\n 

На локальной машине (Windows 10) всё работает. На сервере устанавливал SDK и Hosting пакеты - не помогло. Даже полностью вычищал все установленные версии Net Core. Что-то можно сделать?

Fasjeit commented 2 years ago

Добрый день. С IIS проблема известная, пока, увы, решения нет. Дело в том что iis, судя по всему, использует свой runtime для хостинга приложений.

Пока что единственное решение хостинг через запуск приложения + apache\nginx

Fasjeit commented 2 years ago

Скорее всего должен работать out of process iis (https://docs.microsoft.com/ru-ru/aspnet/core/host-and-deploy/iis/out-of-process-hosting?view=aspnetcore-6.0)