相关疑难解决方法(0)

InvalidProgramException/Common Language Runtime检测到无效程序

这是我在很长一段时间内看到的最奇怪的编程问题.

我正在使用Microsoft Visual C# 2010 Express,C#.NET 2.0开发一个应用程序.这个应用程序引用了几个dll/程序集(这些dll都是在我的机器上生成的).

下面是代码的一部分(这是所有基本的东西):

public class PowerManagement
{

    [TestCase]
    public void PrepareTest(){
        // Configure according to pre-conditions
        Preconditions precondition = new Preconditions();
        precondition.SetupPreconditions();
            ...
    }

    [TestCase]
    public void PerformTest(){
        TestcaseData testcaseData = new TestcaseData();

        // Set Trigger and perform check
        switch (testcaseData.triggerNumber){
            case (1):
                if ((new Trigger1(testcaseData)).Validate() != 1)
                    Report.TestStepFail("failed");
                break;
            ...
            case (4):
                if ((new Trigger4(testcaseData)).Validate() != 1)
                    Report.TestStepFail("failed");
                break;
            default:
                Report.TestStepFail("Not yet implemented");
                break;
        }
    } …
Run Code Online (Sandbox Code Playgroud)

.net c# dll exception

20
推荐指数
7
解决办法
4万
查看次数

标签 统计

.net ×1

c# ×1

dll ×1

exception ×1