2011-09-27 35 views
0

我使用的.NET Framework 3.5,我引用的所有程序集,我有双重检查一切,但还是这个恼人的错误在System.Diagnostics中找不到过程类? (System.dll中???)

CS0234: The type or namespace name 'Process' does not exist in the namespace    
'System.Diagnostics' (are you missing an assembly reference?) (CS0234) (Proj1) 

根据MSDN和其他各种来源,Process类肯定位于System.Diagnostics名称空间中的System.dll中。那么世界上是什么是问题?

+1

System.dll在您的项目和正确的版本中被明确引用? (v2.0.50727) –

+1

针对Silverlight或其他 - 你也问了很多单声道问题。 –

+0

您是否尝试过在Visual Studio中创建新项目并检查您是否能够引用Process类? – Trainee4Life

回答

5

确保您引用了正确的System.Dll。该版本应该大致v2.0.50727

0

我也面临同样的问题。我使用CodeDom来执行需要Process Class的代码。所以我的解决方案是在选项中引用System.dll。这是解决方案,如果有人需要的话。

CSharpCodeProvider cs = new CSharpCodeProvider(); 
cs.CompilerOptions = "/optimize /reference:System.dll";