© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2d ago•
10 replies
Cake

[✅ SOLVED] Difference between `typeof(...).Assembly`

beginner
is there a difference from doing
// Extensions/MediatRExtensions.cs

public static class MediatRExtensions
{
...
var assembly = typeof(MediatRExtensions).Assembly // and use this in the AddMediatR config
...
}
// Extensions/MediatRExtensions.cs

public static class MediatRExtensions
{
...
var assembly = typeof(MediatRExtensions).Assembly // and use this in the AddMediatR config
...
}

vs
passing
// Program.cs
var assembly = typeof(Program).Assembly
// Program.cs
var assembly = typeof(Program).Assembly

to the extension method as a the second param and use that instead?
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

❔ Difference between these variants
C#CC# / help
3y ago
✅ typeof()?
C#CC# / help
2y ago
Difference between string and string?
C#CC# / help
8mo ago