27
loading...
This website collects cookies to deliver better user experience
System.Linq
or your own Extensions namespace?global
modifier to the using
you want.global
modifier is the same as adding the same using
directive to every source file in your project.You may add global using directives to any source file. Typically, you'll want to keep them in a single location. The order of global using directives doesn't matter, either in a single file, or between files.
global usings
in a .cs
file but also at the project file.<Using>
item to your project file.<ItemGroup>
<Using Include="MyAwesomeApp.Extensions" />
</ItemGroup>
csproj
files, but Martin remembered me that I can do it in a Directory.Build.props
file (if you want to know more about this file, take a look at this post that I've written to see the potential).Directory.Build.props
in the root folder that contains your source code, when MSBuild runs will add to every project the properties defined in the Directory.Build.props
. So, if you want to do it Solution wise or even only for your Test folder, you can do it.Directory.Build.props
for sure. At least until we see a new standard way to declare global usings emerging in the community.