为什么 PostSharp 导致我的项目构建失败?

发布于 2024-08-16 17:28:43 字数 385 浏览 5 评论 0原文

我正在从事一个单元测试项目。该项目大约有 2600 个测试类,平均每个类有 15 个单元测试。我不确定需要向该项目添加多少个类才能重新创建下面提到的错误,但我确实知道向项目添加大量(我尝试了 500 个)文件与其直接相关。如果我删除一些文件,我就可以构建。

编译错误

未知位置错误 PS0034:PostSharp:ILASM 退出并返回代码 255。 工具输出:

此应用程序已请求运行时以异常方式终止它。 请联系应用程序的支持团队以获取更多信息。

是什么原因导致这种情况发生?

编辑:可能需要注意的是,测试项目不直接使用自定义 PostSharp 属性。换句话说,在所有测试类中都没有 PostSharp dll 的 using 指令。然而,它们用于测试正在测试的类中。

I am working on a unit testing project. This project has roughly 2600 test classes with an average of 15 unit tests per class. I'm not sure how many more classes I need to add to this project to recreate the error mentioned below, but I do know that adding a large amount (I tried 500) of files to the project is directly related to it. If I remove some files, I am able to build.

Compilation errors

unknown_location error PS0034: PostSharp: ILASM exited with return code 255. Tool output:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

What is causing this to happen?

Edit: It might be important to note that that the test project does not use the custom PostSharp attribute directly. In other words, in none of the test classes do I have a using directive for a PostSharp dll. They are, however, used in the classes that the tests are testing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泅人 2024-08-23 17:28:43

一般来说,要调试 ILASM 错误,我至少需要查看 ILASM 输出。它一定打印了一些更好的错误消息。如果没有看到它,请尝试使用 MSBuild 从命令行进行构建。错误消息应帮助您了解可能的原因并创建重现案例,然后将其提交给我们的问题跟踪器。

如果您说您的项目没有方面(即使是间接的),您可以通过包含编译符号“SkipPostSharp”简单地为该项目使用 skyp PostSharp。

Generally, to debug ILASM errors, I need at least to see the ILASM output. It must have printed some better error message. If you don't see it, try to build from the command line using MSBuild. The error message should help you to understand what the cause could be and to create a repro case, then submit it to our issue tracker.

If you say that your project does not have aspects (even indirectly), you may simply skyp PostSharp for that project by including the compilation symbol "SkipPostSharp".

沉默的熊 2024-08-23 17:28:43

本质上,这可能不是课程的数量,而是你在这些课程中所做的一些不寻常的事情。也就是说,2600 个类肯定是一个很大的数字,因此这可能是一个问题。我会向 PostSharp 人员报告这一点——如果不访问您的代码,StackOverflow 就不可能诊断这里的问题。

要提交问题,请访问此处的 PostSharp 错误跟踪器。

It's probably not the number of classes, per se, but something unusual that you're doing in these classes. That said, 2600 classes is certainly a large number, so it may be possible that this is an issue. I'd report this to the PostSharp folks -- it's going to be impossible for StackOverflow to diagnose the problem here without access to your code.

To submit an issue, visit the PostSharp bug tracker here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文