Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin IOS System.DllNotFoundException: 'Crypt32.dll assembly:<unknown assembly> type:<unknown type> member:(null)' #1931

Closed
briancfertig opened this issue Oct 16, 2021 · 8 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue queued s3

Comments

@briancfertig
Copy link

I am working on an IOS application and everything is going swimmingly until I went to initialize my s3client. When I do I get the error above. I launch it in the sim and it fails. I have searched high and low looked a various articles and white papers. No go. I wrote a .net WinForms app that works just fine. Any ideas? Is there some other way I should be doing this?

@ashishdhingra ashishdhingra added bug This issue is a bug. s3 labels Oct 18, 2021
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Oct 18, 2021

Hi @doclemo,

Good morning.

Thanks for opening the issue. I found reference to Crypt32.dll in UserCrypto class, this appears to be the Windows specific assembly. If you see the exception handling in IsUserCryptAvailable, it also appears to log the error UserCrypto is not supported. This may be due to use of a non-Windows operating system or Windows Nano Server, or the current user account may not have its profile loaded.. Also refer #507 (comment) in case your scenario is similar.

Could you please share the sample code and information in the following format?

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

  • AWSSDK.Core version used:
  • Service assembly and version used:
  • Operating System and version:
  • Visual Studio version:
  • Targeted .NET platform:

.NET Core Info

  • .NET Core version used for development:
  • .NET Core version installed in the environment where application runs:
  • Output of dotnet --info:
  • Contents of project.json/project.csproj:

Thanks,
Ashish

@ashishdhingra ashishdhingra added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 18, 2021
@briancfertig
Copy link
Author

briancfertig commented Oct 18, 2021

Could you please share the sample code and information in the following format?

App.s3client = s3routines.Gets3Client();

public static class s3routines
{
    public static AmazonS3Client Gets3Client()
    {
        AmazonS3Config s3config = new AmazonS3Config
        {
            RegionEndpoint = RegionEndpoint.USEast1,
            ForcePathStyle = true
        };
        var client = new Amazon.S3.AmazonS3Client(App.akid, App.sak, App.sessionToken, s3config);
        return client;
            //New AmazonS3Client(App.akid, App.sak, App.sessionToken, s3config) ;
    }
}

Expected Behavior

Object initialized so I can call routines to interact with S3 bucket.

Current Behavior

Object called for initialization and fails saying Crypto32.dll missing.

Possible Solution

Find alternate method for accessing S3 API via Xamarin Forms.

Steps to Reproduce (for bugs)

Launch in Xamarin.Forms IOS application.

Context

Your Environment

  • AWSSDK.Core version used: 3.7.3.22
  • Service assembly and version used: AWSDK.S3 3.7.3.15
  • Operating System and version: Xamarin.Forms IOS
  • Visual Studio version: 16.11.4
  • Targeted .NET platform: .NET Standard 2.1

.NET Core Info

  • .NET Core version used for development:
  • .NET Core version installed in the environment where application runs:

Core not being used.

  • Output of dotnet --info:

D:\Source Code\asbuiltgui-mobile>dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.402
Commit: e9d3381880

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.402\

The application is Xamarin Forms IOS application. I am testing it there.

Host (useful for support):
Version: 5.0.11
Commit: f431858f8b

.NET SDKs installed:
2.1.522 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

  • Contents of project.json/project.csproj:
netstandard2.1 true C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.Xamarin.iOS.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Barcode.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Chart.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Common.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.ConversationalUI.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.DataControls.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.DataGrid.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.DataVisualization.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.ImageEditor.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Input.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Map.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.PdfViewer.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.Primitives.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.RichTextEditor.dll C:\Program Files (x86)\Progress\Telerik UI for Xamarin R2 2021\Binaries\iOS\Telerik.XamarinForms.SkiaSharp.dll MSBuild:UpdateDesignTimeXaml

Thanks, Ashish

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 19, 2021
@briancfertig
Copy link
Author

Can we get this fixed? Is there an ETA? Is there something I can do to patch this and keep it from erroring out?

@csm101
Copy link

csm101 commented Nov 16, 2021

I am getting the same DLLNotFound exception in my Xamarin.Android app.
it happens when I try to initialize a new AmazonSQSClient
SqsClient = new AmazonSQSClient(AwsAccessKeyId, AwsSecretAccessKey, RegionEndpoint.EUWest1);

The weird thing is that this works fine if I build the same project using VS 2019... the bug happens only if use VS 2022

@briancfertig
Copy link
Author

briancfertig commented Nov 16, 2021 via email

@quibenefacit
Copy link

quibenefacit commented Oct 21, 2022

I am encountering the same error:

'Crypt32.dll assembly: unknown assembly type: unknown type member:(null)'

with the latest version of Visual Studio 2022 (17.3.6) when deploying a Debug build onto an Android device or emulator.

No problem or error when deploying a Release build.

@dscpinheiro
Copy link
Contributor

We just released an update (included in Core 3.7.303.23) where the SDK won't attempt to load Crypt32.dll when not running on Windows.

It does require targeting .NET 8 (or greater), but should prevent this error from happening in iOS or Android.

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue queued s3
Projects
None yet
Development

No branches or pull requests

5 participants