How Outsystems handle with app.config from the .xif?

How Outsystems handle with app.config from the .xif?

  

Hi People,

I need to create an Extension (.xif) to be able to consume a complex WSDL. I need to have there the app.config to play with certificates and other stuff.

We created a perfect test .NET application that is working. We have data :)

No we want to use an extention to work with the data in Outsystems.

Question:

How Outsystems handle with the App.Config from the Extentions? 

If I use that Extention in one "Test App" that has its own AppConfig the compiler append the Extention app.config content (ClassLibrary Output Type) in the StartUp Project app.config content (Windows Application Output Type)?

This because I'm guetting this annoying error: 

The type initializer for 'myclass' threw an exception. 

I read this and this issue in my Project (console output type) that I use to test the class (the project needs to have its own app.config)

"This error can arise if you are calling the service in a class library and calling the class library from another project."
In this case you will need to include the WS configuration settings into the main projects app.config if its a winapp or web.config if its a web app. This is the way to go even with PRISM and WPF/Silverlight.”

My experience with .NET is almost null and I'm a little stuck with this error. If you say to me that the app.config content is appended (I hope yes) I should have ither problem

Thanks for the help

Nuno Oliveira wrote:

Hi People,

I need to create an Extension (.xif) to be able to consume a complex WSDL. I need to have there the app.config to play with certificates and other stuff.

We created a perfect test .NET application that is working. We have data :)

No we want to use an extention to work with the data in Outsystems.

Question:

How Outsystems handle with the App.Config from the Extentions? 

If I use that Extention in one "Test App" that has its own AppConfig the compiler append the Extention app.config content (ClassLibrary Output Type) in the StartUp Project app.config content (Windows Application Output Type)?

This because I'm guetting this annoying error: 

The type initializer for 'myclass' threw an exception. 

I read this and this issue in my Project (console output type) that I use to test the class (the project needs to have its own app.config)

"This error can arise if you are calling the service in a class library and calling the class library from another project."
In this case you will need to include the WS configuration settings into the main projects app.config if its a winapp or web.config if its a web app. This is the way to go even with PRISM and WPF/Silverlight.”

My experience with .NET is almost null and I'm a little stuck with this error. If you say to me that the app.config content is appended (I hope yes) I should have ither problem

Thanks for the help

Hi,

"We created a perfect test .NET application that is working." - This is good..

Did you create extension in OS?

Did you add all library in the extension that you used in your .net code?

Did you copy paste .net project in extension?

Did you take all .net references?


Thanks,

Rajat Agrawal


Solution

Hi Nuno,

You can use the Factory Configuration: https://www.outsystems.com/forge/component/25/factory-configuration for this.

The web.config (which is the equivalent of the app.config for web applications) can be updated from the Factory Configuration.

  1. Open Factory Configuration.
  2. Got to tab Shared Configurations.
  3. Create a New Shared Configuration.
  4. Choose the OSTrace Pre-made sample and click 'Fill'.
  5. Copy a large part of your app.config file (between the <System._TheNameOfYourConfiguration_> opening and closing tags.
  6. Rename the template osTrace to the _TheNameOfYourConfiguration_.
  7. Find the occurences of system.diagnostics and rename to _TheNameOfYourConfiguration_.
  8. Give your Shared Configuration a name and a description and click Create.
  9. Go to eSpaces and find the eSpaces that are calling the extension (all of them, from the first screen/timer that triggers the action that drills down to the last eSpace that calls the extension).
  10. Republish your eSpaces.
  11. Try to call the webservice.

Kind regards,

Remco Dekkinga

Solution

Remco Dekkinga wrote:

Hi Nuno,

You can use the Factory Configuration: https://www.outsystems.com/forge/component/25/factory-configuration for this.

The web.config (which is the equivalent of the app.config for web applications) can be updated from the Factory Configuration.

  1. Open Factory Configuration.
  2. Got to tab Shared Configurations.
  3. Create a New Shared Configuration.
  4. Choose the OSTrace Pre-made sample and click 'Fill'.
  5. Copy a large part of your app.config file (between the <System._TheNameOfYourConfiguration_> opening and closing tags.
  6. Rename the template osTrace to the _TheNameOfYourConfiguration_.
  7. Find the occurences of system.diagnostics and rename to _TheNameOfYourConfiguration_.
  8. Give your Shared Configuration a name and a description and click Create.
  9. Go to eSpaces and find the eSpaces that are calling the extension (all of them, from the first screen/timer that triggers the action that drills down to the last eSpace that calls the extension).
  10. Republish your eSpaces.
  11. Try to call the webservice.

Kind regards,

Remco Dekkinga

Hello,


The template that got generated from OSTrace seems to be about logs? Is that right?
If so, where in the already generated code do I have to post my part of the code?


Greetings,
Niels F.