csproj copy files depending on operating system

For differentiating between Windows & Mac/Linux you can use the $(os) property: this gives you Windows_NT for Windows and UNIX for Mac/Linux. For differentiating between Mac & Linux, at least on recent versions of MSBuild, you can use RuntimeInformation.IsOSPlatform. So, combined, your csproj can have something like this: <ItemGroup> <Content Include=”libNative.dll” Condition=” ‘$(OS)’ == ‘Windows_NT’ … Read more

A full explanation for the ResolvedFileToPublish XML element?

Where does SpaRoot get set? SpaRoot is set as a property in the project by the template. Projects contain a “static” portion; that is root-level PropertyGroup and ItemGroup elements. Note that properties are like a global key-value dictionary (and whenever an XML node in a PropertyGroup defines a property, it overwrites existing ones with the … Read more

What is the difference between “none include” and “none update” in SDK-style csproj projects?

What is the difference between update and include? According to this document: Usage: Include attribute => The file or wildcard to include in the list of items. Update attribute => Enables you to modify metadata of a file that was included by using a glob. Working Scope: Include attribute: 1.Works for both normal .net framewrok(non-sdk … Read more

What is server garbage collection in ASP.NET Core?

It seems to be the difference between Normal (Workstation) and Concurrent (Server) Garbage Collection strategies. Basically the Workstation approach runs into issues in many extreme cases. And massively Multithreaded scenarios (like ASP Webservers) are prime examples of such an extreme case: https://social.msdn.microsoft.com/Forums/en-US/286d8c7f-87ca-46b9-9608-2b559d7dc79f/garbage-collection-pros-and-limits?forum=csharpgeneral Note that concurrent GC has natural issues with weak references and defragmentation, but … Read more

How to make Sonarqube exclude a .NET (C#) project from coverage measures

Summing up the above mentioned answers and also adding one point to it. To exclude a project from SonarQube Analysis from csproj we can achieve by adding the below code in .csproj of that project <PropertyGroup> <!– Exclude the project from analysis –> <SonarQubeExclude>true</SonarQubeExclude> </PropertyGroup> To exclude a file from a project <ItemGroup> <SonarQubeSetting Include=”sonar.coverage.exclusions”> … Read more

Add a msbuild task that runs after building a .NET Core project in Visual Studio 2017 RC

An alternative is to use the AfterTargets attribute on the Target. Something like: <Target Name=”TestTarget” AfterTargets=”Build”> <Message Importance=”High” Text=”This is a test” /> </Target> I’m not sure why “AfterBuild” wouldn’t work any more, but this appears to be a conscious decision by the maintainers of MSBuild (h/t to Livven on pointing me to this github … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)