question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow changing the name or namespace of ThisAssembly class

See original GitHub issue

We encountered the following scenario where `ThisAssembly caused a build break.

  1. Project A has ThisAssembly generated and also [InternalsVisibleTo] for project B
  2. Project B also has ThisAssembly. When it tries to use it, build fails because of ambiguous ThisAssembly class.

The solution to this issue may be either naming ThisAssembly class differently, or placing it inside a namespace (root namespace of the project, perhaps). For backward compatibility, this should be opt-in.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexrpcommented, Jan 29, 2023

@AArnott Given the above, can we reopen this? (I’ll try to find time to do a PR for this eventually, but in the meantime, someone might come across this and feel like contributing the enhancement.)

1reaction
AArnottcommented, Aug 3, 2022

I don’t think we’d add a boolean switch to forcibly link the namespace of ThisAssembly to RootNamespace. Rather, if we made the namespace flexible I’d say just take a string switch and let it be anything (including $(RootNamespace)).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing Assembly Name gives errors
You'll need to fix up all of the references to that assembly to use the new name. Depending on how you made the...
Read more >
Add `private` and `namespace` accessibility modifiers for ...
I think that the BEST part of this proposal is namespace access modifier. It's a perfect way to get rid of ugly nested...
Read more >
Resolved - Using classes within a namespace
I'm trying to use this class: namespace Microsoft.MixedReality.Toolkit.UI { public class SliderSync : RealtimeComponent {...
Read more >
AssemblyBuilder Class (System.Reflection.Emit)
Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly.
Read more >
devlooped/ThisAssembly: Exposes project and assembly ...
Exposes project and assembly level information as constants in the ThisAssembly class using source generators powered by Roslyn.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found