{"id":16974824,"url":"https://github.com/3f/netfx4sdk","last_synced_at":"2026-01-04T21:41:11.310Z","repository":{"id":144758130,"uuid":"443330922","full_name":"3F/netfx4sdk","owner":"3F","description":"Developer Pack (SDK). NETFX 4: Visual Studio 2022 / MSBuild 17 / or other modern tools","archived":false,"fork":false,"pushed_at":"2024-04-08T19:32:03.000Z","size":60,"stargazers_count":40,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T15:25:35.966Z","etag":null,"topics":["build","continuous-integration","developer-tools","development","development-environment","devtools","environment","getnutool","hack","hmsbuild","msbuild","net40","netframework","netframework4","sdk","tools","visual-studio","visualstudio","visualstudio2022","vs2022"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3F.png","metadata":{"files":{"readme":"Readme.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"custom":["3F.github.io/Donation"]}},"created_at":"2021-12-31T11:33:11.000Z","updated_at":"2024-12-23T08:41:57.000Z","dependencies_parsed_at":"2023-12-10T14:27:21.466Z","dependency_job_id":"d1a595b8-2a7e-46a8-8880-a0aafff88786","html_url":"https://github.com/3F/netfx4sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2Fnetfx4sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2Fnetfx4sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2Fnetfx4sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3F%2Fnetfx4sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3F","download_url":"https://codeload.github.com/3F/netfx4sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244868035,"owners_count":20523581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","continuous-integration","developer-tools","development","development-environment","devtools","environment","getnutool","hack","hmsbuild","msbuild","net40","netframework","netframework4","sdk","tools","visual-studio","visualstudio","visualstudio2022","vs2022"],"created_at":"2024-10-14T01:08:20.209Z","updated_at":"2026-01-04T21:41:11.304Z","avatar_url":"https://github.com/3F.png","language":"Batchfile","funding_links":["3F.github.io/Donation"],"categories":[],"sub_categories":[],"readme":"# [netfx4sdk](https://github.com/3F/netfx4sdk)\n\nAn attempt to provide *.NET Framework 4.x* Developer Packs (SDKs) support for modern Visual Studio / MSBuild / etc.\n\n* Various modes;\n* Rollback support (changes can be easily undone at any time);\n* Pure LF protected batch-script (.bat/.cmd) that does NOT require *powershell* or *dotnet-cli*;\n* Portable and flexible solution;\n  * Internet connection is NOT needed for system mode;\n  * Lightweight and text-based, about ~11 KB + ~18 KB;\n* Free and Open source https://github.com/3F/netfx4sdk\n\nBased on [hMSBuild.bat](https://github.com/3F/hMSBuild) + [GetNuTool](https://github.com/3F/GetNuTool)\n\n```r\nCopyright (c) 2021-2025  Denis Kuzmin \u003cx-3F@outlook.com\u003e github/3F\n```\n\n[ 「 ❤ 」 ](https://3F.github.io/fund) [![License](https://img.shields.io/badge/License-MIT-74A5C2.svg)](https://github.com/3F/netfx4sdk/blob/master/License.txt)\n[![Build status](https://ci.appveyor.com/api/projects/status/7d2jae48fii2m99o/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/netfx4sdk/branch/master)\n[![release](https://img.shields.io/github/release/3F/netfx4sdk.svg)](https://github.com/3F/netfx4sdk/releases/latest)\n\n## Quick start\n\n* Using GetNuTool: [`gnt`](https://3F.github.io/GetNuTool/releases/latest/gnt/)`~netfx4sdk`\n* Using hMSBuild: [`hMSBuild`](https://3F.github.io/hMSBuild/releases/latest/gnt/)`-GetNuTool ~netfx4sdk`\n* GitHub Releases: https://github.com/3F/netfx4sdk/releases/latest\n\nFor example: [`gnt`](https://3F.github.io/GetNuTool/releases/latest/gnt/)`~netfx4sdk \u0026 netfx4sdk -mode sys-or-pkg`\n\nOr build and use from source:\n\n```bat\ngit clone https://github.com/3F/netfx4sdk.git src\ncd src \u0026 build \u0026 cd bin\\Release\\raw\\\nnetfx4sdk -help\n```\n\nNote: starting with 2.0, in addition to `-rollback`, you can also use `-stub` key to check the commands for all planned changes without actually affecting the file system.\n\n## Why netfx4sdk\n\n*netfx4sdk* allows you to easily use the legacy (deprecated) SDK for modern toolsets and IDEs such as VS2022+ / MSBuild 17+ / and other tools without installing any other outdated versions of Visual Studio.\n\nBecause Microsoft officially dropped support of the **Developer Pack** (SDK) for .NET Framework 4.0. Now it can only be a **Runtime** version: https://dotnet.microsoft.com/en-us/download/visual-studio-sdks\n\nMeans you [can't simply **build** anything](https://ci.appveyor.com/project/3Fs/vssolutionbuildevent/builds/42027332#L121) along with pure VS2022 (e.g. [VM image, clean VS2022 env](https://ci.appveyor.com/project/3Fs/vssolutionbuildevent/builds/42027332#L121))\n\n\u003e MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, **install the Developer Pack** (SDK/Targeting Pack) for this framework version or retarget your application. You can (\\*no, you can't) download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks\n\nBut *netfx4sdk* will try to eliminate this artificial limitation by a single command,\n\n* Here's [**result**](https://ci.appveyor.com/project/3Fs/vssolutionbuildevent/builds/42060343#L6) using *netfx4sdk 1.0* for the same clean VS2022 VM image above.\n\n### List of supported SDKs\n\n1.x\n\n* .NET Framework 4.0\n\n2.0+\n\n* .NET Framework 2.0\n* .NET Framework 3.5\n* .NET Framework 4.0\n* .NET Framework 4.5\n  * .NET Framework 4.5.1\n  * .NET Framework 4.5.2\n* .NET Framework 4.6\n  * .NET Framework 4.6.1\n  * .NET Framework 4.6.2\n* .NET Framework 4.7\n  * .NET Framework 4.7.1\n  * .NET Framework 4.7.2\n* .NET Framework 4.8\n  * .NET Framework 4.8.1\n\n### LF / CRLF\n\nStarting with 2.0, *netfx4sdk.cmd* now fully supports LF and uses this by default instead of CRLF.\n\nIt means *.gitattributes* control for CRLF in *netfx4sdk.cmd* is not necessary anymore in cases when *core.autocrlf=input* etc.\nSee related: https://github.com/3F/hMSBuild/issues/2\n\nNote: only *hMSBuild.bat* 2.5+ have the same protection. Full editions ([*hMSBuild.full.bat*](https://github.com/3F/hMSBuild/pull/11)) even for 2.5+ are not protected due to incorrect shiftings in cmd processor when switching to LF.\n\n## Usage\n\n`-mode sys` Hack using assemblies for Windows. Highly *recommended* because:\n\n* [++] All modules are under Windows support.\n* [+] It does not require internet connection (portable).\n* [+] No decompression required (faster) compared to package mode.\n* [-] This is behavior-based hack;\n\n`-mode pkg` will try to apply remote package to the environment.\n\n* [-] Officially dropped support since VS2022.\n* [-] Requires internet connection to receive ~30 MB via GetNuTool.\n* [-] Requires decompression of received data to 178 MB before use.\n* [+] Well known official behavior.\n\n### -help\n\n```bat\n -mode {value}\n   * system            - (Recommended) Hack using assemblies for Windows.\n   * package           - Apply remote package. Read [About modes] below.\n   * sys               - Alias to 'system'.\n   * pkg               - Alias to 'package'.\n   * system-or-package - Fallback to 'system'. Use 'package' if 'system' failed.\n   * package-or-system - Fallback to 'package'. Use 'system' if 'package' failed.\n   * sys-or-pkg        - Alias to 'system-or-package'.\n   * pkg-or-sys        - Alias to 'package-or-system'.\n\n -tfm {version}\n   * 4.0 - Process for .NET Framework 4.0 (default)\n   * 2.0, 3.5, 4.5, 4.6, 4.7, 4.8\n   * 4.5.1, 4.5.2, 4.6.1, 4.6.2, 4.7.1, 4.7.2, 4.8.1\n\n -force      - Aggressive behavior when applying etc.\n -rollback   - Rollback applied modifications.\n -global     - To use the global toolset, like hMSBuild.\n -no-mklink  - Use direct copying instead of mklink (junction / symbolic).\n -stub       - Use a stub instead of actual processing.\n -sdk-root   - Custom path to the SDK root directory.\n -no-acl     - Do not copy ownership and ACL information when direct copying.\n\n -pkg-version {arg} - Specific package version in pkg mode. Where {arg}:\n     * 1.0.3 ...\n     * latest - (keyword) To use latest version;\n\n -debug    - To show debug information.\n -version  - Display version of netfx4sdk.cmd.\n -help     - Display this help. Aliases: -help -h -?\n```\n\n### Examples\n\n```bat\nnetfx4sdk -mode sys\nnetfx4sdk -rollback\nnetfx4sdk -debug -force -mode package\nnetfx4sdk -mode pkg -pkg-version 1.0.2\nnetfx4sdk -mode pkg -tfm 4.5\nnetfx4sdk -global -mode pkg -tfm 3.5 -no-mklink -force\ncall netfx4sdk -mode sys || call netfx4sdk -mode pkg\nnetfx4sdk -mode sys-or-pkg\nnetfx4sdk -mode pkg -tfm 3.5 -sdk-root \"path\\to\" -no-mklink -no-acl\n```\n\n## Integration with scripts\n\n### batch (.bat, .cmd)\n\n*netfx4sdk.cmd* is a pure batch script. Therefore, you can easily combine this even inside other batch scripts. Or invoke this externally, there's nothing special:\n\n```bat\nset sdk=netfx4sdk -mode package -force -global -no-mklink\n\ncall %sdk% -tfm 4.5.2 || (\n    echo Failed\u003e\u00262\n    call %sdk% -tfm 4.5.1 || goto fallback\n)\n```\n\nMore actual examples can be found in [tests/](tests/) folder.\n\n### .sha1 official distribution\n\n*netfx4sdk* releases are now accompanied by a *.sha1* file in the official distribution; At the same time, commits from which releases are published are signed with the committer's verified signature (GPG).\n\nMake sure you are using official, unmodified, safe versions.\n\nNote: *.sha1* file is a text list of published files with checksums in the format: \n\n`40-hexadecimal-digits` `\u003cspace\u003e` `file`\n\n```\ne9e533b0da8e5546eff821a40fbf7ca20ab9cf7e path\\file\n...\n```\n\n#### netfx4sdk.cmd validation\n\nSince *netfx4sdk.cmd* relies on the [hMSBuild](https://github.com/3F/hMSBuild) and [GetNuTool](https://github.com/3F/GetNuTool), you can validate it like: \n\n\u003e hMSBuild -GetNuTool ~\u0026 svc.gnt -sha1-cmp netfx4sdk.cmd sha1 -package-as-path\n\nor\n\n\u003e gnt ~\u0026 svc.gnt -sha1-cmp netfx4sdk.cmd sha1 -package-as-path\n\nWhere *sha1* is the checksum from the [official distribution](https://github.com/3F/netfx4sdk).\n\nOr, the official [package](https://www.nuget.org/packages/netfx4sdk/) (`gnt +netfx4sdk`) provides *validate.hMSBuild.bat*; this is wrapper of the command above.\n\nHow safe is it?\n\n* [hMSBuild.bat self validation](https://github.com/3F/hMSBuild/?tab=readme-ov-file#hmsbuildbat-self-validation)\n* [gnt.bat self validation](https://github.com/3F/GetNuTool?tab=readme-ov-file#gntbat-self-validation)\n\n## Contributing\n\n[*netfx4sdk*](https://github.com/3F/netfx4sdk) is waiting for your awesome contributions!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3f%2Fnetfx4sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3f%2Fnetfx4sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3f%2Fnetfx4sdk/lists"}