Salesforce

.NET Troubleshooting (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

.NET Troubleshooting (Magic xpa 4.x)

Q1

How come I can't see the values of the .NET variable that I defined in the Main Program?

A1

.NET variables in Magic xpa represent .NET objects. The .NET variable keeps only a reference to the .NET object; therefore, any properties of the .NET object are not stored in the Magic xpa .NET variable. This has various implications on how the program works. Please see .NET Variables vs .NET Objects for additional information.

Q2

How come my 3rd party .NET component is not working?

A2

If you want to use a 3rd party .NET component, you must have the System.Windows.Forms assembly loaded in the CRR.

Q3

When starting the Studio from a network path, why am I getting the "This is not a valid assembly" error while loading a .NET dll in the CRR?

A3

Change the order of the V4 and V2 .NET entries in the MgxpaRuntime.exe config file.

Q4

When starting the Studio from a network path, why am I getting the "Failed to load MgDotNet.dll" error when pressing F8 on a program that has a .NET variable?

A4

Change the order of the V4 and V2 .NET entries in the MgxpaRuntime.exe config file.

Q5

How come the .ecf file that I generated in Background mode using the Tools Infrastructure does not show a .NET control?

A5

This happens when .NET version 4 assemblies are used (it works fine with .NET version 2 assemblies) and when AutomaticProcessingMode=B (Background mode).

This is because the Microsoft® .NET Framework Common Language Runtime (CLR) version loads assemblies from the MgxpaRuntime.exe process. However, if the automatic processing is done in Background mode, the Runtime engine is not loaded. So, you will not get the CLR version.

The API that is used to load the assemblies needs this version and if a null version is sent to it, it loads assemblies lower than 4.

Solution 1:

Add the following to the MgxpaStudio.exe.config file:

&ltstartup useLegacyV2RuntimeActivationPolicy="true">

&ltsupportedRuntime version="v4.0" />

&ltsupportedRuntime version="v2.0.50727" />

</startup>

Solution 2:

Use a .NET 3.5 framework dll instead of the .NET 4.0 framework dll.

Q6

Why am I getting an exception error when using .NET?

A6

This happens when you are using an unsigned DLL on a network drive with a client/server program.

To solve this problem, make sure that the DLL that you are using is signed with a strong name. You can do this with Microsoft's Strong Name tool (Sn.exe).

Q7

Why am I getting the "An unhandled Microsoft .NET Framework exception occurred in MgxpaStudio.exe [5264].” error when zooming into the Form Editor?

A7

To solve this issue, you have to explicitly install .NET Framework 2.0 and .NET Framework 3.5, even though they seem to be installed.

Q8

Why am I getting a "Failed to Load Assembly" error even though I loaded the assemblies?

A8

To solve this, try loading into the CRR the referenced assemblies that are listed in the CRR tooltip.

Reference
Attachment 
Attachment