Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WindowsFormsLicenseProvider Error

Hello, i'm having the following problem: I have an application (bin) in a server and i'm trying run it from my computer. When the application tries to create an WaveformGraph object, I get the below error. When I run the application in local, it works fine.

 

Thank you.

 

System.MethodAccessException
       Message="NationalInstruments.UI.WindowsForms.Internal.WindowsFormsLicenseProvider..ctor()"
       Source="mscorlib"
       StackTrace:
            en System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
            en System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
            en System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
            en System.Activator.CreateInstance(Type type, Boolean nonPublic)
            en System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
            en System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
            en System.Activator.CreateInstance(Type type, Object[] args)
            en System.SecurityUtils.SecureCreateInstance(Type type, Object[] args)
            en System.ComponentModel.LicenseManager.ValidateInternalRecursive(LicenseContext context, Type type, Object instance, Boolean allowExceptions, License& license, String& licenseKey)
            en System.ComponentModel.LicenseManager.ValidateInternal(Type type, Object instance, Boolean allowExceptions, License& license)
            en System.ComponentModel.LicenseManager.Validate(Type type, Object instance)
            en NationalInstruments.UI.WindowsForms.WaveformGraph..ctor()
            ...
          

Message Edited by Laura F. on 06-24-2009 02:12 PM
0 Kudos
Message 1 of 5
(3,843 Views)

Sorry, I forgot saying that the object is created in the following way:

 

Assembly assembly = Assembly.LoadFrom("xxxxx");

Type type = assembly.GetType("yyyyy");

Object = Activator.CreateInstance(type);

 

If it is created in a "normal" way, there isn't problem.

 

Thank you!

0 Kudos
Message 2 of 5
(3,841 Views)

It looks to me like the problem is that you are creating the control using reflection and you are running the program from a location with security permissions configured not to allow reflection. Have you tried creating a core Framework data type (as opposed to an MStudio data type) through reflection and running it in this scenario to see if it works? If this doesn't work, then I'm pretty confident that you'll need to fix this problem by granting refelection permission to your application, using the .NET Framework Configuration Tool.

 

 

David Rohacek

National Instruments

0 Kudos
Message 3 of 5
(3,821 Views)

That's right. I've set Full Trust for Intranet using caspol.exe in the 2.0 Framework directory: capol.exe -q -m -ag All_code -zone Intranet FullTrust.

 

Important: You can use "Microsoft .NET Framework 1.1 Wizards" only if you work with Framework 1.1.

 

Thank you.

Message 4 of 5
(3,808 Views)

You're welcome.
I appreciate you posting the details.

 

David Rohacek

National Instruments

0 Kudos
Message 5 of 5
(3,772 Views)