I. Definición de Discriminación en el empleo
1.3 Tratados Internacionales relacionados con el trato digno de la mujer
Do this by right-clicking the project in Solution Explorer window of Visual Studio, and then clicking Add YourProjectName to AOT.
This action causes Visual Studio to send various project files to the AOS, including the assembly .dll file. The AOS saves the contents of these files in its metadata stores.
4. Start a new Microsoft Dynamics AX AX32.exe client.
In some cases in which the project creates an .exe file instead of a .dll file, an alternative is to press the F5 key in Visual Studio to run the code. This also creates a client connection to the AOS.
5. In your AX32.exe client, run X++ code to test the new assembly .dll.
Find a bug that requires a fix.
6. In Visual Studio, modify the C# code, and then compile the assembly again.
Each compile action sends the updated binary .dll file contents to the AOS to replace the older version in the metadata stores.
7. Run X++ code to test the modified assembly.
A problem is encountered in the last step of the previous list. The AOS has already loaded the earlier version of the assembly. You can start the hot-swap feature to make the AOS load the updated version of the assembly for each new connection.
The following sections describe the scenarios for the two possible states of the hot- swap configuration option.
Scenario with Hot-Swapping Off
The hot-swap configuration value is set to off when Microsoft Dynamics AX is installed. Under this default, one application domain is created when the AOS starts. No additional domains will be created. All .NET Framework assemblies that are loaded into the AOS share the single domain. Also, the single domain is shared by all client connections.
To test the updated assembly, you must restart the AOS. Then connect an AX32.exe client to the AOS, and run the tests. Having to restart the AOS after every compilation is inconvenient. The inconvenience is increased if other developers are sharing the same AOS, because their connections are broken with each restart. Their connections can be from an AX32.exe client, and from Visual Studio.
You do not have to stop and restart the AOS when you want the AOS to load a new assembly that it has not loaded before.
Scenario with Hot-Swapping On
Each new application domain is populated with the versions of assembly .dlls that are available to the AOS when the .dlls are loaded into the new domain. In any given application domain, no updates can be made to any assembly .dll that is already loaded into the domain.
In Visual Studio, after you modify your C# code and again compile the assembly .dll, you have to start a new AX32.exe client to gain access to the updated assembly for testing.
FIGURE 2.6 HOT-SWAPPING ON: EACH CLIENT HAS ITS OWN APPDOMAIN IN THE AOS
You can turn on the hot swapping feature of the AOS by following these steps:
1. Open the Microsoft Dynamics AX server configuration utility by clicking Start > Administrative Tools > Microsoft Dynamics AX 2012 Server Configuration.
To change the server configuration, you must run the utility with
CAUTION: You should not use the hot-swap feature in your production
environment. The AOS might consume lots of memory caused by an accumulation of application domains. Many assemblies would be loaded multiple times, which would waste memory resources.
Summary
The Framework Features chapter introduced several different frameworks available in Microsoft Dynamics AX.
Developers creating code that is customized by other users should create events where customizations typically occur. Then, developers customizing the original functionality in another layer can subscribe to an event. When the customized functionality is tied to an event, the underlying application code can then be rewritten and it will have little effect on the customization, if the same events are raised in the same sequence from one version to the next.
There are many technologies that you can use to programmatically integrate Microsoft Dynamics AX with other applications so that you can integrate functionality or exchange data. These technologies include the following.
• Application Integration Framework (AIF)
• .NET Business Connector
• .NET Framework
You can use a proxy class for classes, tables, and enums. A proxy class is a .NET Framework class that provides access to one X++ item type of Microsoft
Dynamics AX.
Additionally, you can use the .NET interop from X++ to access classes in assemblies that are managed by the CLR in X++ code, and you can use AOT >
References or AOT > Visual Studio Projects to deploy your .NET assemblies for interop.
Test Your Knowledge
Test your knowledge with the following questions.
1. What is the primary difference between using a reference versus a Visual Studio project to deploy a .NET assembly for interop?
2. TRUE or FALSE? An X++ int does not marshal to a System.Int64, or the reverse. A System.Int32 does not marshal to an X++ int64, or the reverse.
( ) TRUE ( ) FALSE
3. Match the eventing terms with their definitions.
_____ 1. The logic that contains the code that causes a change.
_____ 2. The definition of the information passed from the producer to the consumer when an event occurs
_____ 3. The application code that represents an interest in being notified when a specific event occurs.
_____ 4. A representation of a change that happened in the producer.
_____ 5. The information that the event carries with it.
a. Event b. Delegate c. Event payload d. Producer e. Consumer
5. Which of the following methods can be used to subscribe to an event? (Select all that apply)
( ) Create an event handler underneath a method.
( ) Create an event handler underneath a delegate.
( ) In X++ by using the following command: [DelegateName] +=
EventHandler::[EventHandlerName]
( ) In X++ by using the following command" [EventHandlerName] +=
Delegate::[DelegateName]
6. You can build proxies for which of the following X++ item types? (Select all that apply)
( ) Base enumerations ( ) Extended data types ( ) Tables
( ) Classes
Quick Interaction: Lessons Learned
Take a moment and write down three key points you have learned from this chapter
1.
2.
3.
Solutions
Test Your Knowledge
1. What is the primary difference between using a reference versus a Visual Studio project to deploy a .NET assembly for interop?
MODEL ANSWER:
AOT > References require ongoing deployments, whereas AOT > Visual Studio Projects do not require you to redeploy the .dll files.
2. TRUE or FALSE? An X++ int does not marshal to a System.Int64, or the reverse. A System.Int32 does not marshal to an X++ int64, or the reverse.
(•) TRUE ( ) FALSE
3. Match the eventing terms with their definitions.
d 1. The logic that contains the code that causes a change.
b 2. The definition of the information passed from the producer to the consumer when an event occurs e 3. The application code that represents an interest in being notified when a specific event occurs.
4. TRUE or FALSE? You should only use the hot-swap feature in your production environment.
( ) TRUE (•) FALSE
5. Which of the following methods can be used to subscribe to an event? (Select all that apply)
(√) Create an event handler underneath a method.
(√) Create an event handler underneath a delegate.
(√) In X++ by using the following command: [DelegateName] +=
EventHandler::[EventHandlerName]
6. You can build proxies for which of the following X++ item types? (Select all that apply)
(√) Base enumerations ( ) Extended data types (√) Tables
(√) Classes