使用Microsoft.CodeAnalysis Nuget程序包会导致WACK失败

时间:2018-07-10 09:25:10

标签: c# roslyn roslyn-code-analysis desktop-bridge

我计划使用Desktop Bridge在Microsoft Store中发布WPF应用程序。应用正在使用.NET编译器平台(“ Roslyn”)。我的问题是该应用当前无法通过2次WACK测试。

失败1:调试配置。 发现错误:调试配置测试检测到以下错误:

The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.Globalization.Calendars.dll is built in debug mode.
The binary System.Threading.Tasks.Parallel.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.Xml.XmlDocument.dll is built in debug mode.
The binary System.Diagnostics.FileVersionInfo.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.IO.FileSystem.DriveInfo.dll is built in debug mode.
The binary System.Net.Ping.dll is built in debug mode.
The binary System.ComponentModel.Primitives.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Net.NameResolution.dll is built in debug mode.
The binary System.ComponentModel.dll is built in debug mode.
The binary System.Runtime.InteropServices.dll is built in debug mode.
The binary System.Diagnostics.Process.dll is built in debug mode.
The binary System.Collections.Concurrent.dll is built in debug mode.
The binary System.Reflection.Primitives.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Text.Encoding.dll is built in debug mode.
The binary System.Reflection.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.IO.UnmanagedMemoryStream.dll is built in debug mode.
The binary System.IO.IsolatedStorage.dll is built in debug mode.
The binary System.Net.WebSockets.Client.dll is built in debug mode.
The binary System.Resources.Reader.dll is built in debug mode.
The binary System.Linq.Parallel.dll is built in debug mode.
The binary System.Collections.dll is built in debug mode.
The binary System.Linq.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Diagnostics.Contracts.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Diagnostics.Tools.dll is built in debug mode.
The binary System.Collections.NonGeneric.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Linq.Expressions.dll is built in debug mode.
The binary System.Runtime.Handles.dll is built in debug mode.
The binary System.Net.Security.dll is built in debug mode.
The binary System.Threading.Timer.dll is built in debug mode.
The binary System.ComponentModel.EventBasedAsync.dll is built in debug mode.
The binary System.Net.WebHeaderCollection.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.IO.FileSystem.Watcher.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Runtime.CompilerServices.VisualC.dll is built in debug mode.
The binary Microsoft.Win32.Primitives.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Runtime.Extensions.dll is built in debug mode.
The binary System.Text.Encoding.Extensions.dll is built in debug mode.
The binary System.Security.Principal.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Globalization.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.ObjectModel.dll is built in debug mode.
The binary System.Collections.Specialized.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.IO.Compression.ZipFile.dll is built in debug mode.
The binary System.AppContext.dll is built in debug mode.
The binary System.Diagnostics.TraceSource.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.Security.Claims.dll is built in debug mode.
The binary System.Console.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.IO.Pipes.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.Linq.Queryable.dll is built in debug mode.
The binary System.Security.Cryptography.Csp.dll is built in debug mode.
The binary System.Security.Cryptography.Primitives.dll is built in debug mode.
The binary System.IO.dll is built in debug mode.
The binary System.Dynamic.Runtime.dll is built in debug mode.
The binary System.Net.NetworkInformation.dll is built in debug mode.
The binary System.Security.Cryptography.X509Certificates.dll is built in debug mode.
The binary System.Resources.Writer.dll is built in debug mode.
The binary System.Net.Primitives.dll is built in debug mode.
The binary System.Net.Requests.dll is built in debug mode.
The binary System.Runtime.Serialization.Formatters.dll is built in debug mode.
The binary System.Runtime.Numerics.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Xml.XmlSerializer.dll is built in debug mode.
The binary System.Resources.ResourceManager.dll is built in debug mode.
The binary System.IO.FileSystem.dll is built in debug mode.
The binary System.ComponentModel.TypeConverter.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary System.Text.RegularExpressions.dll is built in debug mode.
The binary System.Diagnostics.TextWriterTraceListener.dll is built in debug mode.
The binary System.Threading.Thread.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Utilities.Core.resources.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Drawing.Primitives.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.IO.MemoryMappedFiles.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Threading.dll is built in debug mode.
The binary System.Xml.XDocument.dll is built in debug mode.
The binary System.Net.WebSockets.dll is built in debug mode.
The binary Microsoft.Build.Tasks.Core.resources.dll is built in debug mode.
The binary System.Diagnostics.Debug.dll is built in debug mode.
The binary System.Security.Cryptography.Encoding.dll is built in debug mode.
The binary System.Xml.XPath.dll is built in debug mode.
The binary System.Runtime.Serialization.Json.dll is built in debug mode.
The binary System.Xml.ReaderWriter.dll is built in debug mode.
The binary System.Reflection.Extensions.dll is built in debug mode.
The binary System.Threading.Tasks.dll is built in debug mode.
The binary System.Threading.ThreadPool.dll is built in debug mode.
The binary Microsoft.Build.resources.dll is built in debug mode.
The binary System.IO.FileSystem.Primitives.dll is built in debug mode.
The binary System.Runtime.dll is built in debug mode.

如果未解决,则会受到影响:Microsoft Store不允许调试版本的应用。

失败2:阻止的可执行文件 发现错误:被阻止的可执行文件测试检测到以下错误:

File CsToDartTranspiler.WPF\Microsoft.Build.dll contains a reference to a "Launch Process" related API kernel32.dll!CreateProcessW
File CsToDartTranspiler.WPF\Microsoft.Build.dll contains a reference to a "Launch Process" related API System.Diagnostics.Process.Start
File CsToDartTranspiler.WPF\Microsoft.Build.Utilities.Core.dll contains a reference to a "Launch Process" related API System.Diagnostics.Process.Start
File CsToDartTranspiler.WPF\Microsoft.Build.Tasks.Core.dll contains a reference to a "Launch Process" related API kernel32.dll!CreateProcessW
File CsToDartTranspiler.WPF\Microsoft.Build.Tasks.Core.dll contains a reference to a "Launch Process" related API System.Diagnostics.Process.Start
File Microsoft.Build.dll contains a blocked executable reference to "Microsoft\MSBuild".
File Microsoft.Build.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.dll contains a blocked executable reference to "msbuild.exe".
File Microsoft.Build.dll contains a blocked executable reference to "SOFTWARE\Microsoft\MSBuild".
File Microsoft.Build.Framework.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.Tasks.Core.dll contains a blocked executable reference to "cmd.exe".
File Microsoft.Build.Tasks.Core.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.Tasks.Core.dll contains a blocked executable reference to "MSBuild.exe".
File Microsoft.Build.Utilities.Core.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.Utilities.Core.dll contains a blocked executable reference to "MSBuild.exe".
File Microsoft.Build.Utilities.Core.dll contains a blocked executable reference to "cmd.exe".
File Microsoft.CodeAnalysis.Workspaces.Desktop.dll contains a blocked executable reference to "Msbuild".
File System.Runtime.InteropServices.dll contains a blocked executable reference to "DnX".
File System.Runtime.Serialization.Formatters.dll contains a blocked executable reference to "DnX".
File System.Security.Cryptography.Encoding.dll contains a blocked executable reference to "DnX".
File System.Text.Encoding.Extensions.dll contains a blocked executable reference to "DnX".
File System.Threading.dll contains a blocked executable reference to "DnX".
File System.Xml.XDocument.dll contains a blocked executable reference to "DnX".
File System.Xml.XmlSerializer.dll contains a blocked executable reference to "DnX".
File Microsoft.Build.resources.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.resources.dll contains a blocked executable reference to "MSBuild.exe".
File Microsoft.Build.Tasks.Core.resources.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.Utilities.Core.resources.dll contains a blocked executable reference to "MSBuild".
File Microsoft.Build.Tasks.Core.resources.dll contains a blocked executable reference to "Reg".

如果未解决,将产生影响:在Windows 10 S系统上,启动可执行文件受到限制。依赖此功能的应用程序可能无法在Windows 10 S系统上正常运行。

我不确定该应用是否会因为“失败2”而被拒绝(个人而言,我对Windows 10 S模式不感兴趣)。

我的应用程序中的所有模块都是使用Release配置构建的。这是引用Microsoft.CodeAnalysis的模块的packages.config:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.CodeAnalysis" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Analyzers" version="2.6.1" targetFramework="net461" developmentDependency="true" />
  <package id="Microsoft.CodeAnalysis.Common" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.CSharp.Workspaces" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.VisualBasic" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.VisualBasic.Workspaces" version="2.8.2" targetFramework="net461" />
  <package id="Microsoft.CodeAnalysis.Workspaces.Common" version="2.8.2" targetFramework="net461" />
  <package id="System.AppContext" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
  <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net461" />
  <package id="System.Composition" version="1.2.0" targetFramework="net461" />
  <package id="System.Composition.AttributedModel" version="1.2.0" targetFramework="net461" />
  <package id="System.Composition.Convention" version="1.2.0" targetFramework="net461" />
  <package id="System.Composition.Hosting" version="1.2.0" targetFramework="net461" />
  <package id="System.Composition.Runtime" version="1.2.0" targetFramework="net461" />
  <package id="System.Composition.TypedParts" version="1.2.0" targetFramework="net461" />
  <package id="System.Console" version="4.3.1" targetFramework="net461" />
  <package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.FileVersionInfo" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.StackTrace" version="4.3.0" targetFramework="net461" />
  <package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
  <package id="System.Dynamic.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Globalization" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem" version="4.3.0" targetFramework="net461" />
  <package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.Linq" version="4.3.0" targetFramework="net461" />
  <package id="System.Linq.Expressions" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection" version="4.3.0" targetFramework="net461" />
  <package id="System.Reflection.Metadata" version="1.6.0" targetFramework="net461" />
  <package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net461" />
  <package id="System.Runtime.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net461" />
  <package id="System.Runtime.Numerics" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.2" targetFramework="net461" />
  <package id="System.Text.Encoding" version="4.3.0" targetFramework="net461" />
  <package id="System.Text.Encoding.CodePages" version="4.5.0" targetFramework="net461" />
  <package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net461" />
  <package id="System.Threading.Thread" version="4.3.0" targetFramework="net461" />
  <package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
  <package id="System.Xml.ReaderWriter" version="4.3.1" targetFramework="net461" />
  <package id="System.Xml.XDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath" version="4.3.0" targetFramework="net461" />
  <package id="System.Xml.XPath.XDocument" version="4.3.0" targetFramework="net461" />
</packages>

用于重现问题的简单测试应用:https://github.com/kinex/roslyn_test

如何解决这些问题?

2 个答案:

答案 0 :(得分:0)

Windows App认证套件包含许多测试,可帮助确保您的应用已准备好发布到Microsoft Store。

  

失败1:调试配置。发现错误:调试配置测试检测到以下错误:

根据Windows Desktop Bridge app tests调试配置测试部分,调试配置测试用于测试应用程序,以确保它不是调试版本,并且未链接到任何调试框架。要解决此问题,如果您已经使用发布配置进行了构建,请检查是否安装了正确版本的.NET Framework。

  

失败2:可执行文件被阻止错误:可执行文件被检测到以下错误:

这属于包装完整性测试。对于桌面桥应用程序,此测试可帮助您构建更好的桌面桥应用程序以在Windows 10 S计算机上运行。对于存档文件使用错误,您可以尝试从存档文件中删除可执行文件,并且不要使用自解压存档将可执行文件放置在磁盘上。对于“被阻止的可执行文件”警告,如果标记的文件是应用程序的一部分,则可以忽略该警告。

详细信息,请检查Windows Desktop Bridge app tests文档中每个测试的“纠正措施”部分。

答案 1 :(得分:0)

失败1和失败2都可以忽略,尤其是因为它们源自Microsoft开发的模块。这些测试只是WACK中的可选测试,因此即使这些测试失败,您的应用也将在Windows应用商店中被接受。有关详细信息,请参见Windows Desktop Bridge app tests

有关报告的某些详细信息失败:

失败1 :由于Microsoft.CodeAnalysis nuget软件包的某些依赖项中存在问题,所有二进制文件* .resources.dll都包含调试信息(有关问题here的一些讨论) 。我不知道为什么其他(可执行)二进制文件(如System.Collections.dll)被报告为包含调试信息,我认为这是与.NET Framework版本相关的“功能”。但幸运的是,这也可以忽略。

失败2 :无法修复这些“问题”。 Microsoft.CodeAnalysis和相关模块需要做他们需要做的事情。