Dotfuscator 在 Visual Studio 中构建时显示 "was expecting one of:"

Dotfuscator says "was expecting one of:" when building in Visual Studio

我在 Visual Studio 中找到了一个包含 Dotfuscator 项目的解决方案。完全相同的代码库在另一台机器(我的旧笔记本电脑)上正确构建和混淆,但在我新设置的笔记本电脑上却没有。当然,我们让我们的支持合同到期,因为这是在遗留项目中使用的。

构建期间的输出是:

8>Compiling Project  MyAppObfuscation ...
8>Dotfuscator Professional Version 4.41.1.9417-95d9eec7a
8>Copyright 2002-2019 PreEmptive Solutions, LLC All Rights Reserved.
8>Use of this software implies acceptance of accompanying license agreement.
8>Build machine license. This software may be used on binaries for general release.
8>
8>Your protection is out of date. Learn more at https://www.preemptive.com/keep-your-protection-up-to-date?product=dotfuscator&sku=pro&version=4.41.1.9417. Upgrade at https://www.preemptive.com/products/dotfuscator/downloads.
8>
8>Loading Assemblies...
---several of these lines---
8>Running ...\ildasm.exe /OUT=...\MyApp.exe.il /TEXT /NOBAR /RAWEH /QUOTEALLNAMES /UTF8 /LINENUM /FORWARD "...\MyApp.exe"
8>
--- immediately followed by: ---
8>Encountered - at line 18065, column 26.
8>Was expecting one of:
8>    <FLOAT64> ...
8>    "float64" ...
8>    "float32" ...
8>    <INT> ...
8>    "(" ...
8>    
8>Build Error.
8>MyAppObfuscation build failed.

有人遇到过这种情况吗?我倾向于相信这是新机器上的问题,但如果有人有关于诊断此问题的提示,我将不胜感激。

谢谢!

编辑:只是想添加在 Visual Studio 和 Dotfuscator Professional Config Editor 中发生的相同错误。

编辑 2:经过进一步检查,ildasm 的 /OUT 参数中列出的文件夹不包含最后一个 ildasm 命令的 .il 文件。 .exe 之前的程序集的输出文件夹确实有一个 .il 文件。所以,我认为 ildasm 可能在 .exe 上失败,但我可以将命令复制到命令提示符中,它 运行s 正确并按预期创建 .il 文件。那么,为什么 ildasm 在来自 Visual Studio 的 运行 时不工作,但可以从命令行工作——并且只对项目中的一个程序集/exe 工作?

谜团越来越大...

解决了!我在旧机器和新机器上都打开了 Visual Studio 安装程序,以比较旧机器和新机器上安装的功能。最值得注意的是,单个组件选项卡上缺少的功能之一是较旧的 .NET Framework SDK(在我的例子中是 4.6.1)和较旧的 Windows 10 SDK(在我的例子中是 10.0.17763.0)。

希望对其他人有所帮助。