Bug #100959 MySQL.data dll generates unneeded system files dependencies for MS Build
Submitted: 25 Sep 2020 16:17 Modified: 4 Nov 2020 19:31
Reporter: Philippe Lévi Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S5 (Performance)
Version:8.0.21 OS:Windows
Assigned to: CPU Architecture:Any
Tags: Build warnings, Connector .NET

[25 Sep 2020 16:17] Philippe Lévi
Description:
Hello,
Am using Community Edition 8.0.21 and Connector .NET 8.0.21 on Windows 10.

Turns out that, since a few Connector.NET releases, I see a whole bunch of warnings when building my project(s) which use MySQLData dll and are written with VB.NET.

Basically, these warnings refer to the use of Windows system files such as System.IO, System.Tracing etc....

According to Microsoft, these dependencies are generated from MySQL.Data.
Nothing weird except that packaging the project increases its size dramatically and that system files are protected by the OS anyway.

Are you aware of such an issue

Am available to send you any shots you may need.

Cheers

Philippe

How to repeat:
Just generate an application using MySQL.data dll.
In the particular application I'm working on, here's an output of these warnings extracted from the Build Output Window in VS2019, be it in debug or release mode:

WARNING: 'System.Diagnostics.Debug.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Debug\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Debug.dll' is under Windows System File Protection.
WARNING: 'System.Diagnostics.Debug.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Debug\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Debug.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll' is under Windows System File Protection.
WARNING: 'System.Diagnostics.Tracing.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Tracing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Tracing.dll' is under Windows System File Protection.
WARNING: 'System.Diagnostics.Tracing.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Diagnostics.Tracing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Diagnostics.Tracing.dll' is under Windows System File Protection.
WARNING: 'System.Threading.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Threading\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.dll' is under Windows System File Protection.
WARNING: 'System.Threading.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Threading\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll' is under Windows System File Protection.
WARNING: 'System.Resources.ResourceManager.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Resources.ResourceManager\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Resources.ResourceManager.dll' is under Windows System File Protection.
WARNING: 'System.Resources.ResourceManager.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Resources.ResourceManager\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Resources.ResourceManager.dll' is under Windows System File Protection.
WARNING: 'System.IO.Compression.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IO.Compression\v4.0_4.0.0.0__b77a5c561934e089\System.IO.Compression.dll' is under Windows System File Protection.
WARNING: 'System.IO.Compression.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IO.Compression\v4.0_4.0.0.0__b77a5c561934e089\System.IO.Compression.dll' is under Windows System File Protection.
[4 Nov 2020 19:31] MySQL Verification Team
Thank you for the bug report. I couldn't repeat with version 8.0.22:

C:\tmp>csc /r:"C:\Windows\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_8.0.22.0__c5687fc88969c44d\MySQL.Data.dll" program.cs
Microsoft (R) Visual C# Compiler version 3.7.0-6.20514.1 (600c0dad)
Copyright (C) Microsoft Corporation. All rights reserved.

C:\tmp>