安装程序解决方案警告错误:在 VS C# 项目上编译期间“DLL 文件受 Windows 系统文件保护”

问题描述 投票:0回答:1

我正在为 C# 中的 VS 项目buildingInstaller Solution。 在编译过程中,我得到以下

warnings

WARNING: 'System.Linq.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Linq\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Linq.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.Collections.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Collections\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Collections.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.Serialization.Primitives.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization.Primitives\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Serialization.Primitives.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.Threading.Tasks.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Threading.Tasks\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Threading.Tasks.dll' is under Windows System File Protection.
WARNING: 'System.Runtime.Extensions.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.Extensions.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.Reflection.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Reflection\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Reflection.dll' is under Windows System File Protection.
WARNING: 'System.Net.Http.WebRequest.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http.WebRequest\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.WebRequest.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.Reflection.Extensions.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Reflection.Extensions\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Reflection.Extensions.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.Text.Encoding.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Text.Encoding\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Text.Encoding.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.IO.dll' should be excluded because its source file 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IO\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.IO.dll' is under Windows System File Protection.

以及我认为相关的这些:

WARNING: Two or more objects have the same target location ('[targetdir]\system.reflection.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.reflection.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.extensions.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.extensions.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.threading.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.threading.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.diagnostics.debug.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.diagnostics.debug.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.threading.tasks.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.threading.tasks.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.serialization.primitives.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.serialization.primitives.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.io.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.io.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.text.encoding.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.text.encoding.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.io.compression.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.io.compression.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.diagnostics.tracing.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.diagnostics.tracing.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.reflection.extensions.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.reflection.extensions.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.linq.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.linq.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.collections.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.collections.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')

阅读一些相关帖子我相信我应该从安装程序本身中删除这些 dll,这意味着从安装程序解决方案的主要输出中删除...?这是正确的还是其他地方的问题?

另一个问题是——这会损害用户机器上的任何功能吗?所有这些 dll 是否都存在于标准 Windows 上并且无需编译即可运行?

谢谢

c# dll compilation filesystems compiler-warnings
1个回答
0
投票

我认为需要删除所有的 Dll。因为这些在 Windows 操作系统中都是可用的。这就是他们发出警告的原因。

© www.soinside.com 2019 - 2024. All rights reserved.