Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Cannot reference PowerShellStandard from unit tests #35

Open
lzybkr opened this issue Jul 11, 2018 · 1 comment
Open

Cannot reference PowerShellStandard from unit tests #35

lzybkr opened this issue Jul 11, 2018 · 1 comment

Comments

@lzybkr
Copy link
Member

lzybkr commented Jul 11, 2018

It is difficult to reference PowerShellStandard from xunit/mstest style unit tests in a project targeting net46.

A reference assembly with empty implementations (returning null or default(T)) is placed alongside the unit test binaries.

I've worked around this by using Microsoft.PowerShell.5.ReferenceAssemblies, but that is not ideal.

@BernieWhite
Copy link

Have you tried using the private assets option. i.e.

<ItemGroup>
    <PackageReference Include="PowerShellStandard.Library" Version="5.1.0" PrivateAssets="All" />
</ItemGroup>

See Controlling dependency assets

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants