Skip to content

Use executable flags in Microsoft.NET.Test.Sdk #792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
codito opened this issue May 10, 2017 · 3 comments
Closed

Use executable flags in Microsoft.NET.Test.Sdk #792

codito opened this issue May 10, 2017 · 3 comments

Comments

@codito
Copy link
Contributor

codito commented May 10, 2017

This issue is a follow up to the discussion in dotnet/sdk#1178

We can set following flags for test projects:

  • HasRuntimeOutput = true to allow generation of deps file
  • OutputType = dll
  • Remove the logic for auto generation of binding redirects
  • Check if we need to add a flag to disable packaging of test projects? Or it comes automatically?
@nguerrera
Copy link

You need dotnet/msbuild#1310 to be fixed in order to make this change and get binding redirects for a test library.

@Faizan2304 Faizan2304 removed their assignment Jul 7, 2017
@Faizan2304 Faizan2304 modified the milestones: 15.5, 15.5 (Sprint 122) Jul 7, 2017
@Faizan2304
Copy link
Contributor

Changing the milestone as we are blocked on dotnet/msbuild#1310

@remcoros
Copy link

remcoros commented Jan 26, 2021

Any progress on this issue?

Currently, in a test project targeting .NETFramework, which also uses a nuget package containing native platform dlls, we need to set either HasRuntimeOutput to true, or specify a RuntimeIdentifier of win-x86/x64.

We have nuget package containing native x86 and x64 dlls (located inside runtimes/win-x64/native).

When using this package inside a net48 Exe/WinExe project, we do not need to set 'RuntimeIdentifier' as this is infered from TargetFramework + PlatformTarget.

For a unit test project (which is OutputType=Library), this RuntimeIdentifier is not infered, so during build the native dlls are not copied to the output, resulting in runtime errors.

The unit test project compiles fine, no error or warning is given during build, but due to missing native dlls, this only happens when running the test.

We have to remember to set either HasRuntimeOutput or RuntimeIdentifier in a test project.

For test projects targeting .NETFramework, I think this can be inferred the same way as is done for OutputType Exe/WinExe.

@Evangelink Evangelink added the needs-triage This item should be discussed in the next triage meeting. label Aug 3, 2022
@Evangelink Evangelink removed the needs-triage This item should be discussed in the next triage meeting. label Nov 30, 2022
@nohwnd nohwnd closed this as completed Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants