Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7934279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:36:00+00:00 2026-06-03T21:36:00+00:00

The project The project is a large C# project which is used for test-automation.

  • 0

The project

The project is a large C# project which is used for test-automation. For this purpose i’ve to use a java-tool which is the tool which saves all results into a file which can be loaded into a test-environment.

The interface

I got a DLL from the vendor of the test-environment which is build in C++, this dll loads the java environment and loads the jar files.

Current situation

The java environment is loaded with success, its configured with environment-variables set in C# with this method:

String java = GetJavaInstallationPath();
Environment.SetEnvironmentVariable("PATH", String.Format("{0};{1}", Environment.GetEnvironmentVariable("PATH"), Path.Combine(java, @"bin\client")), EnvironmentVariableTarget.Process);

After this i set the path to the java classes using this code:

Environment.SetEnvironmentVariable("ITEPCLASSPATH",
                String.Format("{0};{1}",
                Path.Combine(iTepPath, "itep.jar"),
                Path.Combine(iTepPath, "libs\\itorx.jar")), EnvironmentVariableTarget.Process);

Which actually should work, it shows the correct value when using Environment.GetEnvironmentVariable("ITEPCLASSPATH") but the C++-DLL tells me that it isn’t working.

When setting the class path by using a external bat-file it works. Some more facts:

  • The application is started by the bat file
  • The path is copied from my generated path of the dll
  • I don’t comment anything out, so the path is still set by C#

It seems that java is not accessing the env.-variable i set in C# but recognizes that i set it in the bat file.

I really need to set the variable via C#, how do i archive this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:36:02+00:00Added an answer on June 3, 2026 at 9:36 pm

    It is not explicitly written in Microsoft System.Environment documentation but the target value Process seems to limit scope to the current process only. By default, the CreateProcess method inherits current process environment for the child process. Maybe the parameters used there breaks this default behavior.

    So I propose you test first with EnvironmentVariableTarget.User in SetEnvironmentVariable to see if it works better.

    By the way, I think you will have to diagnose further environment variable and create process operations with tool like Process Monitor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had a large Silverlight project with an unwieldy web.config, which used transforms against
Our team is currently working on a large project which makes heavy use of
I am working on a fairly large C++ project which unfortunately doesn't really use
I am going to be developing a large project which will include a large
I have a large project in Vb.net which drives a web browser control around.
I'm working on a large project (for me) which will have many classes and
In my project there are large no. of FIXME / TODO which are to
I've been assigned to a large legacy project, which can only be deployed in
I have a project which uses a large library residing in its own repository.
I'm working on a project which generates a very large number of sequential text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.