question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native DLL not found with dotnet cli win-x64 while testing with xunit targeting net451

See original GitHub issue

Steps to reproduce

project.json:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },
  "dependencies": {
    "xunit": "2.1.0-*",
    "dotnet-test-xunit": {
      "version": "1.0.0-rc2-*",
      "target": "package"
    },
    "Microsoft.NETCore.Platforms": "1.0.1-rc2-*"
  },
  "frameworks": {
    "net451": {
    }
  },
  "testRunner": "xunit"
}

Program.cs:

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

Commands:

dotnet restore
dotnet test

Expected behavior

Working test run, as with .NET Core 1.0 RC2:

xUnit.net .NET CLI test runner (64-bit win10-x64)
  Discovering: test-xunit
  Discovered:  test-xunit
=== TEST EXECUTION SUMMARY ===
   test-xunit.dll  Total: 0
SUMMARY: Total: 1 targets, Passed: 1, Failed: 0.

Actual behavior

xUnit.net .NET CLI test runner (32-bit win10-x86)
System.DllNotFoundException: Die DLL "Microsoft.DiaSymReader.Native.x86.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.

The error message says, that the file Microsoft.DiaSymReader.Native.x86.dll could not be found.

The full build output is stored in .\Debug\net451\win7-x64, which only contains a Microsoft.DiaSymReader.Native.amd64.dll.

When I specify an explicit -r win7-x86, the output gets stored in .\Debug\net451\win7-x86, but - according to the Process Monitor - gets searched for in the .\Debug\net451\win7-x64 folder.

Using the x86 version of dotnet-cli works as expected for both net451 and netcoreapp1.0.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview1-002702)

Product Information:
 Version:     1.0.0-preview1-002702
 Commit Sha:  6cde21225e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
CoreyKaylorcommented, May 19, 2016

Followed the recommendations on the xunit issue and was able to get things working again.

2reactions
mswietlickicommented, May 18, 2016

I noticed that as a temporary fix adding C:\Program Files\dotnet\sdk\1.0.0-preview1-002702\runtimes\win-x86\native to Env:Path helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Native DLL not found with dotnet cli win-x64 while testing ...
The error message says, that the file Microsoft.DiaSymReader.Native.x86.dll could not be found. The full build output is stored in .\Debug\ ...
Read more >
Xunit Unit Tests will not run
To fix, as mentioned here, from the Visual Studio menu, go to Test -> Test Settings -> Default Processor Architecture and set that...
Read more >
Getting started: .NET Core with command line > xUnit.net
In this article, we will demonstrate getting started with xUnit.net and .NET Core (including .NET 5), showing you how to write and run...
Read more >
Dotnet build quiet. 18. In this article. For more information, see ...
I was greeted with Could not execute because the specified command or file was not found. DESCRIPTION Installs dotnet cli.
Read more >
https://dev.azure.com/dotnet/fe18572b-d1ba-496a-9e...
NET Core tools collect usage data in order to help us improve your experience. ... .visualstudio\obj\test.xunit.runner.visualstudio.csproj.nuget.g.targets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found