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.

Define InternalsVisibleTo "attributes" in the csproj file

See original GitHub issue

Many of the AssemblyInfo.cs file’s content are already generated from the project file, meaning in many (or more like most) cases we don’t need to have an AssemblyInfo.cs file in our projects.

There is one quite frequently used assembly level attribute though that still has to be defined as a traditional attribute - the InternalsVisibleToAttribute.

It would be nice if this could also be defined from the project file, which would also mean we could easily define it in a solution level props file, enabling all projects implicitly to see their internals from the test project(s).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sfoslundcommented, Jan 21, 2020

Fixed by #3439

2reactions
ggirard07commented, Jun 3, 2019

@Pilchie thanks for the feedback. Found another workaround on SO in the meantime here https://stackoverflow.com/a/49978185/2242485

Read more comments on GitHub >

github_iconTop Results From Across the Web

Declaring InternalsVisibleTo in the csproj
A convention is to declare assembly attribute in the file AssemblyInfo.cs . With the new SDK-based project, there is no AssemblyInfo.cs by ...
Read more >
Configure InternalsVisibleTo from csproj
Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. and for more detail follow...
Read more >
Visual Studio 2017 and the new .csproj InternalsVisibleTo
The attributes are now auto-generated at build time from the Project > Properties > Package settings. That means you can now add this...
Read more >
InternalsVisibleToAttribute Class (System.Runtime. ...
Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly.
Read more >
Declaring InternalsVisibleTo in a csproj file - Matthew King
A quick overview of how to declare InternalsVisibleTo in a csproj file. ... the InternalsVisibleTo attribute in the AssemblyInfo.cs file.
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