Missing dll, when trying to run a multi project solution using c++ and c#

Viewed 45

I'm using Visual Studio 2022 and I'm working on an existing multi Project Solution using mostly c++/clr Projects and one C# Class Library. It also uses the .Net Framework 4.7.2.

I now want to add a rest-api through an ASP.Net Class Library written in C# using the .Net Standard over the .Net Framework 4.7.2. That Class Library is using a couple NuGet Packages.

  • Microsoft.AspNetCore v2.2.0
  • Microsoft.AspNetCore.HttpsPolicy v2.2.0
  • Microsoft.AspNetCore.Mvc v2.2.0
  • Swashbuckle.AspNetCore v6.4.0

Building the project is not an issue, but when running it, i get a "System.IO.FileNotFoundException" saying it cant find one of the assemblies it relies on. Inspecting the Debug folders of both the startup project and the class library as a reference reveals that all dlls except for a couple of them are present. The ones missing are seemingly random dlls used by the NuGet packages (i.e. System.Buffers v4.0.2.0). Also the Version asked for during runtime and the version off the dll inside the class library are different. Copying the dll does not work.

I further tried using the Class Library in a couple of other projects and got similar results, when mixing it with c++ projects. C# projects seem fine. Now I'm finally out of ideas.

0 Answers
Related