Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file?
相关问题
- How to know full paths to DLL's from .csproj f
- Visual Studio 2019 - error MSB8020: The build tool
- Is It possible to build asp.net core project using
- Delete files older 6 months
- msbuild: build as to a appxbundle (AppxBundle=Alwa
相关文章
- Build errors of missing packages in Visual Studio
- Copy different file to output directory for releas
- Calling a .Net Framework 4 (or Mono) assembly from
- Why doesn't AutogenerateBindingRedirects work
- What does -Ot flag stand for in Visual Studio 2017
- MSBuild - How to build multiple files AND projects
- Optional appsettings.local.json in (new format) vi
- Visual Studio Solution — Any way to create a “spec
Just in case anyone would like to put
InternalsVisibleTo
within a.csproj
file instead ofAssemblyInfo.cs
(a possible scenario is to have a naming convention between a project under test and a test project), you can do it like this:Having this the following code will be generated
inside auto-generated AssemblyInfo.cs (e.g. for Debug configuration and .NET Standard 2.0 target)
To clarify Hans Passant's comment above, you simply have to add InternalsVisibleTo to any cs file in your project. For example, I created an AssemblyInfo.cs file in the root of the project and then added the following content (only):