Skip to content
This repository was archived by the owner on Nov 9, 2018. It is now read-only.
This repository was archived by the owner on Nov 9, 2018. It is now read-only.

Environment variables are not available during unit test execution. #202

@mswolfe

Description

@mswolfe

Hi,

I'm writing xunit tests against class libraries targeting dnxcore50. I've added environment variables to the launchSettings.json file via the Project's properties page, but when I debug the unit test the environment variables are not present. Is this the expected way to add environment variables that are used during test execution?

Here's what my project.json looks like:

{
  "version": "1.0.0-*",
  "description": "",
  "authors": [ "" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {
    "xunit": "2.1.0",
    "xunit.runner.dnx": "2.1.0-rc1-build204",
    "Microsoft.CSharp": "4.0.1-beta-*",
    "System.Collections": "4.0.11-beta-*",
    "System.Linq": "4.0.1-beta-*",
    "System.Runtime": "4.0.21-beta-*",
    "System.Threading": "4.0.11-beta-*"
  },
  "commands": {
    "test": "xunit.runner.dnx"
  },
  "frameworks": {
    "dnxcore50": { }
  }
}

Here's the launchSettings.json

{
  "profiles": {
    "test": {
      "commandName": "test",
      "environmentVariables": {
        "environment": "local"
      }
    }
  }
}

Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions