-
Notifications
You must be signed in to change notification settings - Fork 336
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
Comments
You need dotnet/msbuild#1310 to be fixed in order to make this change and get binding redirects for a test library. |
Changing the milestone as we are blocked on dotnet/msbuild#1310 |
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. |
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 fileOutputType = dll
The text was updated successfully, but these errors were encountered: