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

Dapper Package - Failed to resolve assembly: 'System.Data.Common, Version=0.0.0.0, Culture=neutral, ...' #2079

Open
binosheen97 opened this issue Apr 26, 2024 · 8 comments

Comments

@binosheen97
Copy link

Hi,

If i install the Dapper package in my c# .Net framework 4.8 version project, i am getting the below error in jenkins.
What is the solution for this?

Error:-

  • mono Tool_ERAAvevaEntry/packages/altcover.8.8.21/tools/net472/AltCover.exe --reportFormat=OpenCover --attributeFilter=ExcludeFromCodeCoverage --linecover -r Tool_ERAAvevaEntry/_Reports/coverage.xml --outputDirectory=Tool_ERAAvevaEntry/bin/Debug/__Instrumented -i Tool_ERAAvevaEntry/bin/Debug --assemblyExcludeFilter=NUnit3.+ --assemblyExcludeFilter=nunit+ --assemblyExcludeFilter=Microsoft+
    ........
    ........
    ERROR *** Instrumentation phase failed
    Failed to resolve assembly: 'System.Data.Common, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
@mgravell
Copy link
Member

I have absolutely no idea; this is a core system package, so there's no reason it should be missing; have you tried adding an explicit reference to System.Data.Common at the application level, i.e. having your executable reference System.Data.Common directly instead of just transitively?

@binosheen97
Copy link
Author

Yes, Tried adding dll directly from this path. Still same issue.

"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.8\Facades\System.Data.Common.dll"

@mgravell
Copy link
Member

this sounds like a problem in the build/deploy; I'm not sure how I can help with that - I don't know anything about Jenkins, and System.Data.Common isn't my package... I don't even know what the setup is here, in terms of what I would need to do to repro it.

@binosheen97
Copy link
Author

In my solution, i have 2 projects...

One is the main project - .netframework 4.8 - Windows Application (which contains the package Dapper).
Another project is the test project - .netframework 4.8 - Class library (which contains Nunit packages Nunit, Nunit Console runner and Nunit3 Test adapter).

I think some conflicts happening between these packages. I dont know how to resolve this.

@mgravell
Copy link
Member

If we forget about Jenkins for a moment: does the code work as built? If the problem only happens during this instrumentation, then that sounds like a question for the instrumentation tool, but I would try adding --assemblyExcludeFilter=Dapper+ --assemblyExcludeFilter=System.Data+, purely to see if that helps (I've never used this tool, I'm just guessing from the command-line here)

@binosheen97
Copy link
Author

Yes, the code works as built. Only the error happens during the instrumentation. I will try your suggestion.

@binosheen97
Copy link
Author

Tried with the assemblyExcludeFilter, still same issue....

  • mono Tool_ERAAvevaEntry/packages/altcover.8.8.21/tools/net472/AltCover.exe --reportFormat=OpenCover --attributeFilter=ExcludeFromCodeCoverage --linecover -r Tool_ERAAvevaEntry/_Reports/coverage.xml --outputDirectory=Tool_ERAAvevaEntry/bin/Debug/__Instrumented -i Tool_ERAAvevaEntry/bin/Debug --assemblyExcludeFilter=NUnit3.+ --assemblyExcludeFilter=nunit+ --assemblyExcludeFilter=Dapper+ --assemblyExcludeFilter=System.Data+ --assemblyExcludeFilter=System.Data.Common+ --assemblyExcludeFilter=Microsoft+

Creating folder /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/__Instrumented/
Instrumenting files from /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/
Writing files to /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/__Instrumented/
Creating folder /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/_Reports
=> /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/Dapper.dll
=> /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/AvevaEntry.exe
=> /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/NUnit3.TestAdapter.dll
=> /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/ERAAvevaEntry.Test.dll

Coverage Report: /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/_Reports/coverage.xml
/home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/__Instrumented/NUnit3.TestAdapter.dll

            <=  NUnit3.TestAdapter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null
/home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/__Instrumented/Dapper.dll
            <=  Dapper, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null

Resolved assembly reference 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' as file '/usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.7/System.Data.dll'.

ERROR *** Instrumentation phase failed

Failed to resolve assembly: 'System.Data.Common, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Details written to /home/jenkins/agent/workspace/Test_Mongoose_feature_US565656/Tool_ERAAvevaEntry/bin/Debug/__Instrumented/AltCover-2024-04-26--11-53-39.log

script returned exit code 255

@binosheen97
Copy link
Author

If i remove any one of these package from the project (Nunit console runner or Dapper), then i am not getting the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants