Skip to content

Hosted powershell has no "ref" folder #11320

@Hvid

Description

@Hvid

I created a hosted PowerShell application in c# with .NET core 3.0
This application executes a PowerShell script using the "powershell-yaml" module. It apparently needs access to the .NET Core assemblies.

I get the files published with this in my project file:

<CopyRefAssembliesToPublishDirectory>true</CopyRefAssembliesToPublishDirectory>

This property ensures that a "refs" directory is published containing all reference assemblies.

PowerShell though, looks for a "ref" directory:

Steps to reproduce

Publish a c# application referencing System.Management.Automation.dll and have it execute a PowerShell script using the powershell-yaml module.

Expected behavior

I would expect it to look for the "refs" folder with is published when enabling the CopyRefAssembliesToPublishDirectory property.

Actual behavior

It looks for the reference assemblies in "ref", which does not exist.

Environment data

{
  "PSVersion": {
    "Major": 6,
    "Minor": 2,
    "Patch": 3,
    "PreReleaseLabel": null,
    "BuildLabel": null
  },
  "PSRemotingProtocolVersion": {
    "Major": 2,
    "Minor": 3,
    "Build": -1,
    "Revision": -1,
    "MajorRevision": -1,
    "MinorRevision": -1
  },
  "SerializationVersion": {
    "Major": 1,
    "Minor": 1,
    "Build": 0,
    "Revision": 1,
    "MajorRevision": 0,
    "MinorRevision": 1
  },
  "WSManStackVersion": {
    "Major": 3,
    "Minor": 0,
    "Build": -1,
    "Revision": -1,
    "MajorRevision": -1,
    "MinorRevision": -1
  },
  "Platform": "Win32NT",
  "OS": "Microsoft Windows 10.0.17763",
  "GitCommitId": "6.2.3",
  "PSCompatibleVersions": [
    "1.0",
    "2.0",
    "3.0",
    "4.0",
    "5.0",
    "5.1.10032.0",
    "6.2.3"
  ],
  "PSEdition": "Core"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-By DesignThe reported behavior is by design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions