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.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolaszawadacommented, Jun 7, 2017

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):
0reactions
livarcocccommented, Oct 3, 2017

Seems like this issue has been resolved. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.Net Core 2.0 SDK causes ASP.Net 1.1 Web App with ...
If I remove the class library project reference then the runtime error goes away. Falling back to the .Net Core 1.0.4 SDK (uninstall...
Read more >
I'm not able to debug .NET Core source code
Uncheck "Enable Just My Code" and check "Enable Source Link support" in Tools -> Options -> Debugging -> General enter image description here....
Read more >
Can't debug functions in Class Library in Core or Standard ...
Net framework I can debug functions located in my class libraries directly in IDE without using Console or WinForm applications. I can't do...
Read more >
When ASP.NET Core can't find your controller: debugging ...
In this post I describe application parts, how ASP.NET Core uses them to find the controllers in your app, and how to list...
Read more >
Enable debugging for ASP.NET apps - Visual Studio
Select the Debug tab. In the Properties pane, next to Profile, For IIS Express, select IIS Express from the dropdown.
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