Heroku 对 .NET 10 的支持
Heroku Support for .NET 10

原始链接: https://www.heroku.com/blog/support-for-dotnet-10-lts-what-developers-need-know/

## .NET 10 现已在 Heroku 上可用 .NET Conf 2025 发布了 .NET 10,以及 ASP.NET Core 10、C# 14 和 F# 10。Heroku 现在支持使用 .NET 10 构建和运行应用程序,提供对最新功能的即时访问。值得注意的是,.NET 10 是一个长期支持 (LTS) 版本,保证三年支持,使其非常适合生产环境。 此版本意义重大,因为 .NET 8 和 9 将于 2026 年 11 月 10 日停止支持,促使现有用户制定迁移时间表。Heroku 将继续支持 .NET 8 和 9 以及 .NET 10,遵守官方 .NET 支持策略。 主要功能包括 **基于文件的应用程序** – 单文件 .NET 应用程序,用于简化、零配置部署 – 以及采用现代 **.slnx** 解决方案文件格式。Heroku 完全支持 .sln 和 .slnx 格式,并与 .NET 10 SDK 中包含的新 Microsoft 测试平台集成。 已更新文档和资源,包括更新的入门指南,可帮助进行迁移。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Heroku 对 .NET 10 的支持 (heroku.com) 16 分,由 runesoerensen 发表于 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 cultofmetatron 1 分钟前 [–] 我为 Heroku 可能达到的成就感到遗憾。我大致计算了一下我的初创公司在 Heroku 上运行的成本,结果比在 AWS 上运行的成本高出很多,包括我们的专属 DevOps 工程师。他们真的扼杀了 Heroku 对于任何规模大于爱好项目的实用性。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

It’s that time of year for .NET when we get a new major version and a bunch of exciting features. .NET Conf 2025 kicked off earlier today, bringing with it the release of .NET 10, as well as ASP.NET Core 10, C# 14, and F# 10. Congrats (and a big thank you) to the .NET team and everyone who helped get .NET 10 out the door.

At Heroku, we believe you should be able to use language and framework releases when they launch, and we prepare accordingly. You can now build and run .NET 10 apps on Heroku, with buildpack support for new SDK features like file-based apps, .slnx solution files, and more.

Migration and support timelines

This year’s release is significant because .NET 10 is the new Long Term Support (LTS) release, which will be supported for three years. This extended support, including regular updates and security patches, makes it the best release for businesses and developers to build on and migrate to, offering a stable foundation with access to the latest features.

With .NET 10 now available, the clock is ticking on previous versions. Both .NET 8 and .NET 9 will reach End of Support on November 10, 2026. In other words, now is a good time to start planning your migration.

We will continue to support .NET 8 and .NET 9 with consistent, timely updates alongside .NET 10. Our .NET support follows the official .NET support policy, and we are fully committed to providing a stable and secure platform for your .NET applications.

Let’s dive into using .NET 10 on Heroku today!

Zero-config deployment with .NET 10 file-based apps

One of the most exciting features in .NET 10 is file-based apps – .NET applications defined in a single C# file without project or solution files, making it easier than ever to deploy .NET apps to Heroku.

For example, here’s a complete ASP.NET Core 10 web application, HelloHeroku.cs:

// Use the new #sdk directive to pull in the ASP.NET Core SDK
#:sdk Microsoft.NET.Sdk.Web

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();  
  
app.MapGet("/", () => "Hello from .NET 10 on Heroku!");

app.Run();

When you push this to Heroku, the platform detects the *.cs file and uses the .NET buildpack. Since there are no solution or project files, the buildpack treats it as a file-based app, installs the latest .NET SDK, builds and publishes the app, detects and configures it as a web application, and deploys it to serve traffic.


The result is a simple, zero-config experience to get you started quickly, ideal for prototyping and developers new to .NET. And there’s more coming – check out the .NET SDK repository to see what the .NET team is working on!

To learn more about what you can do with file-based apps on Heroku today, see our Dev Center documentation.

SLNX: A modern solution for a modern .NET

For decades, .NET developers have used .sln solution files, a proprietary format introduced in 2002 for Visual Studio. Unlike .NET itself, they haven’t changed much since. In a step towards modernization, the .NET 10 SDK is making SLNX the default format. Heroku ensures a seamless deployment experience by fully supporting both formats.

<solution>
    <project path="MyApp\MyApp.csproj"></project>
</solution>

*.slnx files are easier to read and edit, less likely to cause merge conflicts, and support a wider range of workflows and environments, from Linux shells to Visual Studio on Windows. To migrate existing .sln files, run dotnet solution migrate or see the .NET blog announcement for more details.

Heroku CI and the Microsoft Testing Platform

The .NET 10 SDK integrates the Microsoft Testing Platform (MTP) directly in the dotnet test command. Since Heroku CI runs dotnet test by default, your test suite works out of the box after you migrate your apps.

For more control over the test setup and execution, you can specify custom test commands in your app.json.

Ready to migrate? We’re here to help

To support your .NET 10 migration, we’ve updated all our documentation and resources:

  • The .NET Getting Started app now runs on .NET 10.
  • The ASP.NET Core configuration article includes new guidance for ASP.NET Core 10, including migration away from the now-obsolete IPNetwork and ForwardedHeadersOptions.KnownNetworks APIs (learn more) often used to integrate with Heroku’s router.
  • Apps currently using .NET 10 RC builds on Heroku (with TargetFramework set to net10.0) will automatically be built with the stable .NET 10 release on the next git push. You can pin to specific SDK versions using a global.json file.

For teams migrating from earlier versions, the .NET 10 breaking changes documentation covers important upgrade considerations.

Get started today

We can’t wait to see what you build with .NET 10 on Heroku. From new features like file-based apps to the stability of an LTS release, this is a great time to be a .NET developer.

Check out our updated Getting Started with .NET on Heroku guide and please feel free to reach out with any questions or feedback.

联系我们 contact @ memedata.com