Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using ScatterGraph after upgrading to 8.1

I have just upgraded from Measurement Studio 8.0.1 to 8.1 using VS2005

I had an application using a ScatterGraph that when I try and rebuild it using 8.1 I get an error when trying to instantiate the control using:
this.graphPressures = new NationalInstruments.UI.WindowsForms.ScatterGraph();

The error is:
System.MethodAccessException was unhandled
  Message="Attempt to access the method failed."
  Source="mscorlib"

If I create a new project I can add a ScatterGraph which works without any problems.

If possible I want to fix this problem without recreating the project and copying all the code as it is quite a large project. Any Ideas?
0 Kudos
Message 1 of 10
(5,370 Views)
Hi adamhb,

Try deleting the bin and obj folders that are created in your project's folder, then rebuild the solution, and see if that fixes the behavior.
If that doesn't work, we will need to replicate the situation here on a test machine.
Are there any other factors, or is the situation as simple as an instantiation of a ScatterGraph in an 8.0.1 project in 8.1?

Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 2 of 10
(5,348 Views)
Hi Gavin

Thanks for that, but still getting the same error, have attached a screenshot. No other factors that I can tell, is as simple as an instantiation of a ScatterGraph in an 8.0.1 project in 8.1

Cheers

Adam
0 Kudos
Message 3 of 10
(5,346 Views)
Adam,

Ok.  We will test this here.

Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 4 of 10
(5,331 Views)
I was able to run my project with a ScatterGraph created in 8.0.1, in 8.1.  I didn't get any errors.

Try deleting the references to NationalInstruments.Common, NationalInstruments.UI, and NationalInstruments.UI.WindowsForms, and recreating them, and then rebuilding your project.

Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 5 of 10
(5,312 Views)
Tried your suggestion without success. I also tried making a copy of the WaveformGraph and deleting the old control but this didn't help either. In the process of doing so tho, I discovered that it is also throwing a runtime error when trying to instantiate a Tank control, a Legend control, a DataSocketServer control and a DataSocket control. The Tank and Legend throw the same error (MethodAccessException: Attempt to access the method failed.) whereas the DataSocket controls throw a different error (SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.).
0 Kudos
Message 6 of 10
(5,307 Views)
Ok.  Try removing and readding all .NET Class Libraries by going to your menu, Measurement Studio -> Add/Remove .NET Class Libraries, and unchecking all of them, clicking Finish, then reopening that dialog and selecting all the libraries that were previously checked.  Then rebuild and see if any behavior changes.

If this doesn't work for you, please post some code for us to test.
Gavin Fox
Systems Software
National Instruments
0 Kudos
Message 7 of 10
(5,284 Views)
Tried without success

Have attached some code for you to test, see if can work on a different machine.  I deleted most the classes and form in the project except for the basic ones but still getting the same errors.


0 Kudos
Message 8 of 10
(5,279 Views)
It looks like a .NET security issue. I was able to get rid of the error by going into Properties >> Security and unchecking the "Enable ClickOnce Security Settings" and run the app. You can then check the box again and run the app again. The exception no longer happens, atleast not on my test machine.

I'm not sure what might have caused this to happen. One change could be the fact that we no longer authenticode-sign the Measurement Studio .NET assemblies as described in the readme. We did this to prevent this issue from occuring. I don't belive we added additional security restrictions on the assemblies.

Please try the workaround and let me know how it goes.

Thanks


Message Edited by bilalD on 12-20-2006 09:36 AM

Bilal Durrani
NI
Message 9 of 10
(5,268 Views)
Hi Bilal

Thanks for that, has fixed the problem.

Adam
0 Kudos
Message 10 of 10
(5,241 Views)