Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Things to look for during dev review:

  • TargetFramework set to net48
  • LangVersion set to 7.3
  • NoWarn set to 1591,1587
  • RootPath depends on csproj and sln location
  • AssemblySearchPaths includes RootPath/3rdParty
  • OutputPath set to RootPath/Output
  • AssemblyTitle set to csproj file name
  • <Import Project="$(RootPath)TIME\Solutions\IncludeGlobalAssembly.targets" /> to is set the global assembly
  • <Import Project="$(RootPath)RiverSystem\Solutions\NormalisePdbBuildRoot.targets" /> to configure the normalization of pdbs
  • CopyReferences are done via the Directory.Build.targets (currently lives in time)
  • AppendTargetFrameworkToOutputPath and AppendRuntimeIdentifierToOutputPath are set by Directory.Build.props
  • Compile Remove="file.cs" should be deleted and the "file.cs" should be deleted from the git repo as well.

Example:

...

titleNew csproj example

...

languagexml
linenumberstrue

...

  • is set
  • Project References are set using <ProjectReference Include="..\TIME\TIME.csproj" />
  • dll references are set with
    • private = false
    • specific version = false


Notes:

  • <Import Project="$(RootPath)TIME\Solutions\IncludeGlobalAssembly.targets" /> to set the global assembly - no AssemblyInfo.cs is required anymore - these properties are set in the csproj file.
  • <Import Project="$(RootPath)RiverSystem\Solutions\NormalisePdbBuildRoot.targets" /> to configure the normalization of pdbs
  • CopyReferences are done via the Directory.Build.targets (currently lives in time)
  • AppendTargetFrameworkToOutputPath, AppendRuntimeIdentifierToOutputPath and WarningsAsErrors are set by Directory.Build.props
    • this is to stop the /win/x64 folders from being generated
  • Copy 3rdParty to output is done via the Directory.Build.targets
    • this is done since the Choose/When directives don't seem to work when running the builds via cake/msbuild (they work ok with visual studio 2017/2019)
  • Compile Remove="file.cs" should be deleted and the "file.cs" should be deleted from the git repo as well.


Example:

Expand
titleNew csproj example
Code Block
languagexml
linenumberstrue
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <LangVersion>7.3</LangVersion>
    <NoWarn>1591,1587</NoWarn>
    <RootPath>$(MSBuildThisFileDirectory)..\..\</RootPath>
    <AssemblySearchPaths>$(RootPath)3rdParty;$(AssemblySearchPaths);</AssemblySearchPaths>
    <OutputPath>$(RootPath)Output</OutputPath>
    <AssemblyTitle>TIME.RainfallRunoff</AssemblyTitle>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <RemoveIntegerChecks>false</RemoveIntegerChecks>
    <FileAlignment>4096</FileAlignment>
    <NoWarn>1591,1587</NoWarn>
    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
    <OutputPath>$(RootPath)Output</OutputPath>
    <BaseAddress>285212672</BaseAddress>
  </PropertyGroup>
  <Import Project="$(RootPath)TIME\Solutions\IncludeGlobalAssembly.targets" />
  <Import Project="$(RootPath)RiverSystem\Solutions\NormalisePdbBuildRoot.targets" />
  <ItemGroup>
    <Reference Include="Microsoft.Practices.EnterpriseLibrary.Validation">
      <Private>True</Private>
      <SpecificVersion>False</SpecificVersion>
    </Reference>
    <Reference Include="System.ComponentModel.DataAnnotations">
      <Private>False</Private>
      <SpecificVersion>False</SpecificVersion>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\TIME\TIME.csproj" />
    <ProjectReference Include="..\TIME.Tools\TIME.Tools.csproj" />
  </ItemGroup>
  <ItemGroup>
    <None Include="AWRA\AWRA.cd" />
  </Target>ItemGroup>
</Project>