Illia Khomenko
Writing

Can .NET Framework run on Linux on AWS? No. How to cut the bill until you port

No. .NET Framework 4.x runs only on Windows, and Windows costs $0.046 per vCPU-hour on EC2. Porting to modern .NET is the long-term answer. Optimize CPUs, rightsizing, schedules and container density reduce the bill this quarter.

A .NET Framework application runs on Windows and nothing else. Until it's ported to modern .NET, every vCPU it uses on EC2 carries a $0.046 per hour Windows licence, which on general-purpose instances nearly doubles the price.

Porting takes months. In the meantime there are five things that reduce what the Windows fleet costs, and none of them needs a code change.

Licence only the vCPUs you use

EC2 has supported Optimize CPUs on licence-included Windows instances since October 2025. You reduce the active vCPUs on an instance, keep its memory, and pay the licence for the active ones only.

IIS applications on memory-optimised instances are the usual candidates. AWS's example is an r7i.8xlarge going from 32 vCPUs to 16, which takes $537 a month off the Windows licence. It works with On-Demand and Savings Plans. With Reserved Instances the discount may not apply.

Shrink what's oversized

The licence follows the vCPU count, so an instance with twice the CPUs it needs pays twice the licence. Ten m7i.xlarge Windows servers cost $2,815 a month, of which $1,343 is Windows. If CloudWatch shows them at 15% CPU, the same ten on m7i.large cost half.

Look at burstable instances

The Windows premium on t3 is lower than the flat rate. A t3.xlarge pays $0.0736 an hour for Windows, where an m7i.xlarge pays $0.184. With the instance included, that's $175 a month against $281.

It fits internal applications and low-traffic sites that idle most of the day. CPU use above the instance's baseline is charged extra in unlimited mode, so check the CPU credit graphs for a month before moving anything busy.

Turn non-production off

Windows instances are billed per second. A test environment running twelve hours on weekdays uses 60 of the week's 168 hours. That removes 64% of the compute and 64% of the licence. Instance Scheduler or two EventBridge rules will do it.

Put more applications on fewer vCPUs

Windows containers don't remove the licence. The EC2 hosts pay it per vCPU, and Fargate bills its own OS licence fee for Windows tasks at the same $0.046. What containers change is density. Ten small IIS applications that each had a 2-vCPU server can share a few larger hosts, and the licence is paid on the hosts.

Containerising ten applications is a project of its own, so I'd weigh it against spending the same effort on porting.

Commit in a way that survives the port

A Compute Savings Plan applies to Windows and Linux alike and follows the workload from one to the other. A Standard Reserved Instance is tied to the platform. If any part of the fleet will move to Linux during the term, use the Savings Plan.

Neither one discounts the Windows licence itself. AWS's guidance for Microsoft workloads says it doesn't offer a discount on the licence price.

Then split the estate

Most .NET Framework estates aren't all .NET Framework. Sort the services into three groups:

  • already on modern .NET and deployed to Windows out of habit: move these to Linux now
  • .NET Framework with few Windows dependencies: port these first
  • tied to IIS modules, Windows authentication, COM or WCF server hosting: leave these and apply the five measures above

AWS Transform for .NET automates part of the port for the second group. Start with background workers and internal APIs, where a mistake is cheap.

For what the move is worth once a service is on Linux, see What the Windows Server licence costs on EC2 and .NET on Graviton.

Prices above are AWS list prices for us-east-1, on demand, November 2026.

If you don't know how your Windows fleet splits across those three groups, that's where an audit starts.

Short answers

Can .NET Framework run on Linux on AWS?

No. .NET Framework 4.x runs only on Windows. Modern .NET, version 8 or 10, runs on Linux and on Graviton. An application has to be ported to modern .NET before it can leave Windows.

How much does Windows add to a .NET Framework workload on EC2?

$0.046 per vCPU-hour. On an m7i.xlarge that is $134 a month on top of $147 for the instance, so the Windows instance costs 91% more than the same instance on Linux.

Do Windows containers avoid the licence?

No. EC2 hosts for Windows containers pay the Windows licence per vCPU, and Fargate charges an OS licence fee of $0.046 per vCPU-hour for Windows tasks. Containers help by packing more applications onto the same licensed vCPUs.

Is porting .NET Framework to .NET 8 worth it for the AWS bill?

It pays where the ported service can leave Windows. The same m7i.xlarge costs 48% less on Linux and 58% less on Graviton (m7g.xlarge). Porting effort varies a lot between services, so sort them by how hard they are to port and move the easy ones first.