© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
1 reply
Esa

✅ class library and exposing a type from another namespace

Hi,

in my company we have an underlying core application which runs things. This application has many modules (.dlls) which have apis we can call. So we usually reference those binaries in our solutions. However the way this is done currently is by downloading the binaries from an internal repository and referencing them in our solutions.

I'd like to move this entire process to our private nuget, so that we never have to touch a binary manually again. So currently I've setup a release pipeline to that private nuget source.

Consider the following modules:
CoreApp.Customers.dll
  - ICustomersService.cs
CoreApp.Products.dll
  - IProductsService.cs
CoreApp.Customers.dll
  - ICustomersService.cs
CoreApp.Products.dll
  - IProductsService.cs


I have created a class library solution that mirrors this somewhat:
Internal.CoreApp
  Customers
  Products
Internal.CoreApp
  Customers
  Products


So what I want to achieve is that a developer that needs
ICustomersService
ICustomersService
in their solution can install my nuget package in their solution, and use my extension methods on
IServiceCollection
IServiceCollection
to add
ICustomersService
ICustomersService
to the DI in their .net 7.0 project. And it works so far.

However, when I'm testing this from a different project that has installed my nuget package, I don't have access to the type
ICustomersService
ICustomersService
. I think that is because it doesn't come from the same namespace and is hidden behind my abstraction layer, so how can I expose this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Some namespace and class questions..
C#CC# / help
4y ago
✅ referencing `WebApplication` from a class library
C#CC# / help
3y ago
✅ DialogResult and MessageBox in class (namespace)
C#CC# / help
3y ago
❔ accessing object from a class inside of another class
C#CC# / help
3y ago