sdk: Unable to debug/run netcoreapp1.1 webapi project which has a reference to netstandard1.6 class library

Using Visual Studio Code 1.12.2 on Windows 7 Pro

Steps to reproduce

  1. Create a webapi (dotnet new webapi) “TestWebApi”
  2. Create a class library (dotnet new classlib) “TestClassLibrary”
  3. Add Microsoft.AspNetCore.Mvc reference to “TestClassLibrary”
  4. Change TargetFramework for “TestClassLibrary” to netstandard1.6 (in TestClassLibrary.csproj)
  5. Cut and past Controller folder from “TestWebApi” to “TestClassLibrary”
  6. Add “TestClassLibrary” reference to “TestWebApi” (dotnet add reference …\TestClassLibrary\TestClassLibrary.csproj)
  7. Modify ConfigureServices (Startup.cs) method in “TestWebApi” as services.AddMvc() .AddApplicationPart(typeof(ValuesController).GetTypeInfo().Assembly) .AddControllersAsServices(); and also add appropriate using statement
  8. Hit F5 to debug

Expected behavior

Web api to build and run without any issues and also able to access sample api method (api/values)

Actual behavior

Build error: System.DllNotFoundException: Unable to load DLL ‘combase.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Microsoft.Win32.UnsafeNativeMethods.RoGetActivationFactory(String activatableClassId, Guid& iid, Object& factory) at System.Threading.Tasks.AsyncCausalityTracer…cctor()

Note: dotnet build on individual projects work fine

Environment data

dotnet --info output: .NET Command Line Tools (1.0.4)

Product Information: Version: 1.0.4 Commit SHA-1 hash: af1e6684fd

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.4

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (11 by maintainers)

Most upvoted comments

I’m having the same issue on a Windows 7 machine. Have you been able to resolve this? Combase.dll is not present in the System32 folder.

System.DllNotFoundException: Unable to load DLL 'combase.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.Win32.UnsafeNativeMethods.RoGetActivationFactory(String activatableClassId, Guid& iid, Object& factory)
   at System.Threading.Tasks.AsyncCausalityTracer..cctor()'dotnet.exe' (CoreCLR: clrhost):