Skip to main content

Refering a config file when creating a .NET class

  • March 2, 2012
  • 1 reply
  • 0 views

[Migrated content. Thread originally posted on 01 March 2012]

Hello!

We need to use a webservice. There is written a wrapper for us, that holds all the PROXY information for us. But the Webservice needs a config file. In a C# project, this is called "app.config". We have the same file, with a different name.

The problem is how do I refer to it in the create-verb?
Or can it be referred in another way?

I have written a small C# test program that tries to to the same as my COBOL code should do. If I does not use app.config, it blows up. If I incorporate the app.config to my C# project and build, it works.

In COBOL code, the runtime crashes when we try to create the class that holds the webservice. At the exact same point where my C# code blew up when I did not use the app.config.

So my question is (as above...); how can I refer to the config-file during, or somehow before, the create-verb?

Regards Dagl

1 reply

Stephen Hjerpe
  • Participating Frequently
  • 1100 replies
  • March 2, 2012

[Migrated content. Thread originally posted on 01 March 2012]

Hello!

We need to use a webservice. There is written a wrapper for us, that holds all the PROXY information for us. But the Webservice needs a config file. In a C# project, this is called "app.config". We have the same file, with a different name.

The problem is how do I refer to it in the create-verb?
Or can it be referred in another way?

I have written a small C# test program that tries to to the same as my COBOL code should do. If I does not use app.config, it blows up. If I incorporate the app.config to my C# project and build, it works.

In COBOL code, the runtime crashes when we try to create the class that holds the webservice. At the exact same point where my C# code blew up when I did not use the app.config.

So my question is (as above...); how can I refer to the config-file during, or somehow before, the create-verb?

Regards Dagl
There is currently no way to specify a config file. That capability would require an enhancement request, so that the runtime can specify a config file when it invokes the CLR.