[CSHARP-3571] Strong name issues Created: 13/Apr/21  Updated: 19/Apr/21  Resolved: 19/Apr/21

Status: Closed
Project: C# Driver
Component/s: Packaging
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Eddy Nakamura Assignee: Dmitry Lukyanov (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows using C#


Issue Links:
Duplicate
duplicates CSHARP-1276 Provide Strong-Named Assemblies Backlog

 Description   

Hi,

 

I started to use the MongoDB packages in a C# environment. I recently saw that the package is signed but the DLLs are still no signed or without strong name. With that, when you have a project that signs the DLLs, I can't use MongoDB at all (I call mongodb DLLs using reflection).

 

Below the error:

1>CSC : warning CS8002: Referenced assembly 'MongoDB.Driver, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
1>CSC : warning CS8002: Referenced assembly 'MongoDB.Bson, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
1>CSC : warning CS8002: Referenced assembly 'MongoDB.Driver.Core, Version=2.12.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.

 

Do you have a plan to make the dll's strong named?

If not, can you share somehow a way to just connect in a database using TcpClient?

 

Thank you.



 Comments   
Comment by Dmitry Lukyanov (Inactive) [ 19/Apr/21 ]

Hello ednakamu@microsoft.com,
we will consider this work in the scope of https://jira.mongodb.org/browse/CSHARP-1276, For now, you can try using this guideline: https://docs.microsoft.com/en-us/dotnet/standard/assembly/sign-strong-name#create-and-sign-an-assembly-with-a-strong-name-by-using-the-assembly-linker.

Is there an easy way to connect with Tcp?

no, there is no such way

Comment by Eddy Nakamura [ 15/Apr/21 ]

Hi,

when you upload to nuget.org, the package is automatically signed by nuget.org.

For that thread and looking for Microsoft guidance (that is in the comments thread), it's recommended to strong naming it. But yes. Not a lot of consensuses if should/should not strong name it.

 

I tried to inject with ildasm/ilasm/sn, but there are functions/methods that didn't work properly.

I also tried just to understand the portion of the code where MongoDb authenticates, but that is a lot of source code.
Is there an easy way to connect with Tcp?

 

Thank you

Comment by Dmitry Lukyanov (Inactive) [ 13/Apr/21 ]

Hello ednakamu@microsoft.com ,

  I recently saw that the package is signed

not sure what you mean here, our NuGet package is not signed.

but the DLLs are still no signed or without strong name.

please see this comment in similar ticket: https://jira.mongodb.org/browse/CSHARP-1276?focusedCommentId=3699110&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3699110 

If not, can you share somehow a way to just connect in a database using TcpClient?

I don't think that there is a simple way to do it since you need to use a binary wire protocol to work with the server.

we're considering work to add strong-named versions of our libraries for further releases, currently, we don't have a particular roadmap but we will keep you informed here

Generated at Wed Feb 07 21:45:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.