0
votes

The entire error is as below:

Attempt by security transparent method 'Compat.Button1_Click(System.Object, System.EventArgs)' to access security critical method 'System.Management.ManagementObjectSearcher..ctor(System.String)' failed.

Assembly 'App_Web_d3moi4vm, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself. In order to access security critical code, this assembly must be fully trusted.

This is an website which checks system config of clients computer and displays it.Is this some security issue? how can i overcome this?

      Line 18:     protected void Button1_Click(object sender, EventArgs e)
      Line 19:     {
      Line 20:         ManagementObjectSearcher MOS = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
      Line 21:         foreach (ManagementObject MO in MOS.Get())
      Line 22:         {
1

1 Answers

0
votes

add this line to assemblyinfo.cs:

[assembly: SecurityRules(SecurityRuleSet.Level1)]

see 1 ,2 ,3 for more information. good luck!