Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Jun 23, 2025

  • Wait for NLog v6.1

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1259,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [C:\projects\nlog\src\NLog\NLog.csproj::TargetFramework=net45]

When NET45 is disappears from AppVeyor-build-agents, then it will become difficult to support.

Copy link

coderabbitai bot commented Jun 23, 2025

Walkthrough

Removed .NET Framework 4.5 (net45) targeting across build, test, packaging, and project files; build and create-package calls trimmed targetFramework lists to exclude net45, net45-specific project PropertyGroups and references were removed, and MSBuild nuspec metadata changed from net45 to net46.

Changes

Cohort / File(s) Summary
Build script
build.ps1
Removed net45 from main msbuild targetFrameworks and from several create-package invocations; create-package signature unchanged.
Test runner script
run-tests.ps1
Deleted Windows-only net45 build/test block (msbuild/vstest and exit-code checks) for net45.
Project PropertyGroup removals
src/NLog.OutputDebugString/NLog.OutputDebugString.csproj, src/NLog.RegEx/NLog.RegEx.csproj, src/NLog.Targets.GZipFile/NLog.Targets.GZipFile.csproj, src/NLog/NLog.csproj
Removed conditional <PropertyGroup Condition="$(TargetFramework) == 'net45'"> blocks (titles, DisableImplicitFrameworkReferences, and DebugType where present).
Project refs removed for net45
src/NLog.Targets.AtomicFile/NLog.Targets.AtomicFile.csproj
Removed net45-specific <PropertyGroup> and net45 <ItemGroup> references to System/System.Core.
Test project constants
tests/NLog.UnitTests/NLog.UnitTests.csproj
Removed conditional that defined the NET45 compilation symbol when targeting TestTargetFramework=net45.
Packaging / MSBuild metadata
src/NLog.proj
Switched nuspec/MSBuild packaging metadata from net45 to net46 (TargetFramework Include, ProjectFileSuffix, NuGetDir).

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibbled the net45 thread from the patch,
Swapped it for net46, a tidy little match.
Builds hop lighter, tests skip a lane,
Carrots in packages, snug and plain.
— A rabbit with a rake, happy with the batch 🥕

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 544d1f8 and 9e2bb95.

📒 Files selected for processing (9)
  • build.ps1 (2 hunks)
  • run-tests.ps1 (0 hunks)
  • src/NLog.OutputDebugString/NLog.OutputDebugString.csproj (0 hunks)
  • src/NLog.RegEx/NLog.RegEx.csproj (0 hunks)
  • src/NLog.Targets.AtomicFile/NLog.Targets.AtomicFile.csproj (0 hunks)
  • src/NLog.Targets.GZipFile/NLog.Targets.GZipFile.csproj (0 hunks)
  • src/NLog.proj (1 hunks)
  • src/NLog/NLog.csproj (0 hunks)
  • tests/NLog.UnitTests/NLog.UnitTests.csproj (0 hunks)
💤 Files with no reviewable changes (7)
  • src/NLog.RegEx/NLog.RegEx.csproj
  • src/NLog.OutputDebugString/NLog.OutputDebugString.csproj
  • tests/NLog.UnitTests/NLog.UnitTests.csproj
  • src/NLog/NLog.csproj
  • src/NLog.Targets.GZipFile/NLog.Targets.GZipFile.csproj
  • run-tests.ps1
  • src/NLog.Targets.AtomicFile/NLog.Targets.AtomicFile.csproj
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/NLog.proj
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
🔇 Additional comments (4)
build.ps1 (4)

26-26: net45 removal in main pack: LGTM.

The updated targetFrameworks for NLog core correctly drops net45 while preserving net35 and netstandard TFMs.


38-38: Confirm: Did you also intend to drop net35 for NLog.Targets.GZipFile?

PR title/purpose is net45 removal, but this line also removes net35 (unlike OutputDebugString/RegEx which keep net35). If unintentional, restore net35:

-create-package 'NLog.Targets.GZipFile' '"net46;netstandard2.0;netstandard2.1"'
+create-package 'NLog.Targets.GZipFile' '"net35;net46;netstandard2.0;netstandard2.1"'

39-40: Target list updates for OutputDebugString/RegEx: LGTM.

Both correctly drop net45 and keep net35 + netstandard TFMs.


44-44: Leftover BuildNetFX45 flag — likely inconsistent with dropping net45.

If NLog.proj no longer uses/defines BuildNetFX45 or switched to net46, this may be a no-op or cause confusion. Prefer removing or updating to the new flag.

  • Option A (remove the flag if unused):
-msbuild /t:xsd /t:NuGetSchemaPackage ./src/NLog.proj /p:Configuration=Release /p:BuildNetFX45=true /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal
+msbuild /t:xsd /t:NuGetSchemaPackage ./src/NLog.proj /p:Configuration=Release /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal
  • To verify what to do, run:
#!/bin/bash
# Find any remaining usage/definition of BuildNetFX45
rg -nP 'BuildNetFX45' -C3
# Also check for a replacement flag (e.g., BuildNetFX46)
rg -nP 'BuildNetFX46|BuildNetFx46|BuildNet46' -C3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
build.ps1 (2)

38-40: net45 still targeted in create-package calls — remove to complete the drop.

These calls still pass net45 and will be inconsistent with the csproj changes (and can fail Pack). Remove net45 here.

-create-package 'NLog.Targets.GZipFile' '"net45;net46;netstandard2.0;netstandard2.1"'
+create-package 'NLog.Targets.GZipFile' '"net46;netstandard2.0;netstandard2.1"'

-create-package 'NLog.OutputDebugString' '"net35;net45;net46;netstandard2.0;netstandard2.1"'
+create-package 'NLog.OutputDebugString' '"net35;net46;netstandard2.0;netstandard2.1"'

-create-package 'NLog.RegEx' '"net35;net45;net46;netstandard2.0;netstandard2.1"'
+create-package 'NLog.RegEx' '"net35;net46;netstandard2.0;netstandard2.1"'

44-44: Schema packaging still toggles BuildNetFX45 — update to net46.

Align the schema packaging flag with the new net46 baseline.

-msbuild /t:xsd /t:NuGetSchemaPackage ./src/NLog.proj /p:Configuration=Release /p:BuildNetFX45=true /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal
+msbuild /t:xsd /t:NuGetSchemaPackage ./src/NLog.proj /p:Configuration=Release /p:BuildNetFX46=true /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 70a7d47 and 544d1f8.

📒 Files selected for processing (9)
  • build.ps1 (1 hunks)
  • run-tests.ps1 (0 hunks)
  • src/NLog.OutputDebugString/NLog.OutputDebugString.csproj (0 hunks)
  • src/NLog.RegEx/NLog.RegEx.csproj (0 hunks)
  • src/NLog.Targets.AtomicFile/NLog.Targets.AtomicFile.csproj (0 hunks)
  • src/NLog.Targets.GZipFile/NLog.Targets.GZipFile.csproj (0 hunks)
  • src/NLog.proj (1 hunks)
  • src/NLog/NLog.csproj (0 hunks)
  • tests/NLog.UnitTests/NLog.UnitTests.csproj (0 hunks)
💤 Files with no reviewable changes (7)
  • src/NLog.RegEx/NLog.RegEx.csproj
  • src/NLog/NLog.csproj
  • src/NLog.OutputDebugString/NLog.OutputDebugString.csproj
  • src/NLog.Targets.AtomicFile/NLog.Targets.AtomicFile.csproj
  • tests/NLog.UnitTests/NLog.UnitTests.csproj
  • src/NLog.Targets.GZipFile/NLog.Targets.GZipFile.csproj
  • run-tests.ps1
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/NLog.proj
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
  • GitHub Check: task-list-completed
🔇 Additional comments (1)
build.ps1 (1)

26-26: LGTM: net45 removed from main NLog pack.

Targets now align with the PR scope (net46/net35/netstandard2.0/netstandard2.1).

build.ps1 Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Sep 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.