© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
26 replies
Picarl

How to import objects from external, uncompiled .cs files?

Let's say I have a file named "myCustomObject.cs", and it has a class definition "customObject1".

What would the best way to programmatically load myCustomObject and instantiate a customObject1, but dynamically-so? That is: Without any static references.

I'm expecting that I have multiple objects defined in multiple files (under the same namespace, however) that I need to read and instantiate.
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

✅ How to create new cs and csproj files?
C#CC# / help
2y ago
✅ .net trying to find non-existent cs files
C#CC# / help
3y ago
✅ Consuming external .winmd file in Cs/WinRT
C#CC# / help
2y ago