-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Explicit RID still required for .NET Framework test projects #909
Comments
Adding Blocking Partner since I just "closed as duplicate" an issue that was Blocking Partner. |
@nguerrera this is the issue we chatted about before. Take a look when you have time. |
This will be fixed by #1178 once the test project sets HasRuntimeOutput to true, which is now tracked by microsoft/vstest#792 |
This is not fixed by #1178. Even if you add Repro <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<HasRuntimeOutput>true</HasRuntimeOutput>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="1.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-*" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>
</Project> using Microsoft.Data.Sqlite;
using Xunit;
public class SqliteConnectionTest
{
[Fact]
public void OpensConnection()
{
new SqliteConnection("Data Source=:memory:").Open();
}
} dotnet SDK 2.0.0-preview2-006098 Result
Workdaround <RuntimeIdentifier>win7-x64</RuntimeIdentifier> |
@nguerrera is this just because latest CLI hasn't ingested the SDK? |
I think so. I'll check. |
Yes, that was it. dotnet/cli#6665 is out to update the SDK in the CLI. |
Thanks @nguerrera |
continuing to work around dotnet/sdk#909
…to make the tests work
…826.12 (dotnet#909) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19426.12
RID inference for .NET Framework is conditioned on 'OutputType=exe'. Test projects, however, may still be "executable" even if compile as a library.
This means test projects for .NET Framework with native assets will fail. Either need a RID or users need to set OutputType=exe, which is not the default template setting.
Repro
dotnet restore
dotnet test
Expected
Infers RID to win7-x86/x64 and test work :)
Actual
Tests build, but fail because the native component "sqlite3.dll" is missing from build output.
Details
dotnet --version: 1.0.0-rc4-004883
Workarounds
Add a
<RuntimeIdentifier>
or set<OutputType>exe</OutputType>
.The text was updated successfully, but these errors were encountered: