none
Referencing Net Core Libraries and getting dependencies RRS feed

  • Question

  • With Windows.Forms and WPF moving into Core 3, I've been looking at a couple projects and testing the process of shifting from targeting the 4.7.2 framework to the Net Core 3.  In using the Analysis tool, the core executable and all reference libraries appear to be good candidates for this work and indeed, all were easily converted and compile fine.  My question...

    The project  in question has an executable and 4 libraries.  They reference in the following manner:

    * Executable

    ** Lib 1 (dependency of Exe)

    ** Lib 2  (dependency of Exe)

    *** Lib 3 (dependency of Lib 2)

    In Lib 3 -- I have to make use of a handful of Encodings -- so I add the assembly that provides extended codepage support to Net Core.  My problem, when I compile the Exe, and try to run it, it when a function from Lib 2 calls Lib 3 and makes a call to the codepage dependency, it fails.  I was assuming that when I referenced the assembly, the dependencies for these assemblies would be pulled as well.  

    It looks like just referencing the Release build isn't the proper way to make sure all the necessary dependencies get pulled.  Is there a set of documentation that would walk me through this scenario and the expected approach.  Long-term, this project has close to 20 libraries that will be referenced, and many of these references have dependencies -- so I need to figure out how to solve this simple example so I can move forward in my testing.

    Thanks

    --tr

    Wednesday, December 4, 2019 4:26 AM

All replies

  • Long-term, this project has close to 20 libraries that will be referenced, and many of these references have dependencies -- so I need to figure out how to solve this simple example so I can move forward in my testing.

    I am playing around with a Core 3 Windows form solution using a layered architectural style, MVP UI design pattern and dependency injection using Services, it's been a little difficult, but I keep progressing forward.

    What are the dependency problems you're facing? Like what? When it comes to Core 3 desktop solutions, you're blazing the trail! :)

    Wednesday, December 4, 2019 9:46 AM
  • The main problem that I'm having is that these libraries are discrete (aren't just a part of this application) -- so they are added references.   The problem I have is that when you publish a Net Core app, the app pulls the runtimes outside of core into the published folder int he runtimes folder.   Some of these dependency libraries may have these runtimes as well -- but these are not pulled forward (just the referenced assembly) -- and that is problematic.  I've found if I publish the library and link the assembly that way - it will get more of the runtime dependencies -- but I kind of expected to see these pulled into the runtime folders rather than just dumped in the Exec project folder (kind of messy I think). 

    So, the problem I'm really having is related to the runtime dependencies.  These just don't seem to pull forward and in a manner I would expect.

    --tr

     
    Wednesday, December 4, 2019 1:03 PM
  • Seriously, MSDN needs a Core forum like ASP.NET forums has an ASP.NET Core forum. It's ridiculous that there is not a forum in MSDN forums for .NET Core. 
    Wednesday, December 4, 2019 1:53 PM