D365 (DevVM):更新到 PU28 后 BestPractise 被破坏

D365 (DevVM): BestPractise broken after updating to PU28

我有一个 Dynamics365 DevVM 并将其从 10PU26 更新到 10PU28,以便我在与我正在开发的系统相同的平台版本上进行开发。应用 10pu28 后,我启动了 VisualStudio,更改了一些内容并尝试保存和编译,但发现 BP 已损坏,因此我无法进一步开发。 Visual Studio 记录了以下内容,但我不确定我能做些什么来解决这个问题。

Build started 07/25/2019 06:27.
Build step: Metadata validation started.
  Exception occured while performing operation Validate Metadata. Exception details: Path: []:System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer)
   at Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.CompilationService.ValidateMetadata(String module, String metadataPath, String compilerMetadataPath, IEnumerable`1 referencedAssembliesFolders, IEnumerable`1 elements)
Build step: Metadata validation completed (10 ms).
Build step: X++ compilation, label generation and resource deployment started.
Build step: X++ compilation, label generation and resource deployment completed (670 ms).
Build step: Best practice check started.
  Exception occured while performing operation Best practice checks. Exception details: BP Rule: [Exception occured while performing operation Best practice checks. Exception details]:System.ArgumentNullException: Value cannot be null.
Parameter name: referencedAssembliesFolders
   at Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.MetadataProviderExtensions.AddReferenceProvider(IMetadataProvider provider, IEnumerable`1 referencedAssembliesFolders, IDiagnosticSink diagnostics, String modelModule, MetadataProviderFactory factory)
   at Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.CompilationService.RunBestPracticeChecks(String module, String metadataPath, String compilerMetadataPath, IEnumerable`1 referencedAssembliesFolders, IEnumerable`1 elements, String modelName, Boolean isNormalizedCollectionNeeded)
Build step: Best practice check completed (9 ms).
Build completed (716 ms).

我试图在构建时禁用 运行 BP 作为临时解决方法,但这也没有用。当 BP 被禁用时,我仍然无法编译。这是日志:

Build started 07/25/2019 06:40.
Build step: Metadata validation started.
  Exception occured while performing operation Validate Metadata. Exception details: Path: []:System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Contains[TSource](IEnumerable`1 source, TSource value, IEqualityComparer`1 comparer)
   at Microsoft.Dynamics.Framework.Tools.ILGeneratorAgent.CompilationService.ValidateMetadata(String module, String metadataPath, String compilerMetadataPath, IEnumerable`1 referencedAssembliesFolders, IEnumerable`1 elements)
Build step: Metadata validation completed (8 ms).
Build step: X++ compilation, label generation and resource deployment started.
Build step: X++ compilation, label generation and resource deployment completed (381 ms).
Build completed (409 ms).

如果更新没有成功更新所有组件,可能会导致此问题。如果使用默认拓扑文件进行更新,这又可能会导致这种情况。文档中的documentation by Microsoft is a bit confusing on this part of the update process (see issue 1137). Make sure to change the topology file according to section Collect topology configuration data

我还建议看一下 d365fo.tools, which include the function Invoke-D365SDPInstall,它为您在升级过程中做了很多工作(包括拓扑文件的更新)。