开发者

"ManagementScope " could not be found

I'm getting this error:

CS0246: The type or namespace name 'ManagementScope' could not be found...

On this line:

private ManagementScope plainScope = null;

The project builds fine, however I get the above compiler error during runtime when I try to load any page. Yes, I have the appropriate using System.Management statement. Yes, I have included System.Management as a reference. This is my using statement block:

using System;
using System.Collections.Generic;
using System.Data;
using System.Management;

I have read this question, and my project is targeting the .Net 3.5 Framework, not 4. In case it helps, the offending code is inside a class file which is included in开发者_运维问答 the App_Code directory of the project. The "Build Action", under Advanced Properties of the file is set to "Compile". I believe that this might have something to do with the problem seeing as I was using the System.Management namespace recently in the code-behind of an aspx file and it compiled and ran just fine.


you need to add System.Management in the projects references


Have you considered using fusion?

This tool will log all attempts to load assemblies made by the .Net framework... It shows exactly what file it was looking for and where it tried looking for it.

NB: You need to run it as an administrator to be able to change logging settings. The Log location it prompt for should point at an empty directory if you want to set it manually

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜