这个编译错误时什么意思?
我有下面这一小段C#代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestIDispose
{
public class Program : System.IDisposable
{
public void Dispose()
{
Dispose(true);
GC.Collect();
}
void Dispose(bool disposing)
{
}
~Program()
{
Dispose();
}
static void Main(string[] args)
{
}
}
}
在VS2010里面编译不过,报错说:
2> Description: Checking for required files
2>EXEC : error : MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: The command "if exist dlldata.c goto :END
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: Exit 1
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: :END
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073:
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: :VCEnd" exited with code 1.
2>
2>Build FAILED.
这个既然是C#的代码,怎么错误是在某个.C的dll里面呢? 太奇怪了。