I observed there is a difference in .csproj
file in .Net standard and .Net Core.
In .Net projects all files(.cs,.js etc
) were included in .csproj
file for each project. e.g:
<Compile Include="ViewModel\LiveViewViewModel.cs" />
<Compile Include="ViewModel\RegistrationViewModel.cs" />
<Compile Include="Views\LiveView.xaml.cs">
<DependentUpon>LiveView.xaml</DependentUpon>
</Compile>
But if i see the new .Net Core .csproj
file, there is no mention of any .cs/.js
or any file.
I am very curious to understand how does .net core projects include files while being compiled.
They are now coming from msbuild definition files imported via the Microsoft.NET.Sdk
MSBuild sdk and use wildcards to specify a search pattern based off the project file's location.
The (simplified) equivalent would be if you wrote
<Compile Include="**\*.cs" />
into the project file, which has been supported by msbulid for long time but didn't work well with Visual Studio tooling. The new project system can deal with wildcards much better and then add the appropriate <Compile Remove".."/>
or Update=".."
definition if you exclude some files or change metadata in the properties windows.
The source code for the default items be found here as well as some extra definitions brought in by the web-sdk for ASP.NET Core projects here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With