Empty RootNamespace in Directory.Build.props doesn't work
See original GitHub issueVisual Studio Version: Version 16.7.0 Preview 1.0
Summary:
I want to use empty RootNamespace
for all projects.
But if I place <RootNamespace></RootNamespace>
in Directory.Build.props then Visual Studio uses default value (AssemblyName
).
Steps to Reproduce:
Directory.Build.props:
<Project>
<PropertyGroup>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<RootNamespace></RootNamespace>
<TargetFramework>netstandard2.1</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Expected Behavior:
RootNamespace
should be empty.
Actual Behavior:
RootNamespace
is AssemblyName
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
C# projects importing a props file ignores output type
1 Answer 1 ... The problem is the Sdk attribute on the project element, it will add an implicit import, this results in...
Read more >$(ProjectDir) is empty in Directory.Build.props PreBuildEvent
It turned out that the $(ProjectDir) is empty when executed from Directory.Build.props. It has correct value when we add PreBuildEvent to every project ......
Read more >csproj version patching ignoring my props file
Version patching stopped working after refactor, I suspect it failed to find the file or the <version> property, but cannot tell what is ......
Read more >vcxproj and .props file structure
Build.props and Directory.Build.targets files, which are automatically imported in all MSBuild-based projects. In some cases, customized ...
Read more >Common MSBuild Project Properties
The file is put in the intermediate output path by the build process. This property specifies only file names that don't have path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a workaround, put it in Directory.Builds.targets.
Run
msbuild /pp Foo.project > foo.pp
on your project and you will see the order in which this property is defined. Directory.Build.targets is after the default of the property.