9 ms·
.NET 7 is Available Today
- Kukumber 4y agoNativeAOT is one of the most important feature C# needed, very nice that it is finally coming, i still can't believe it took them this long Congrats to everyone who fought vigorously to make it happen, screw the managers, execs and their surrounding noise, long live to the real engineers at Microsoft
- sylens 4y agoAgreed, I feel like it was the missing piece from their .NET Anywhere story and am curious to see if it creates an uptick in adoption
- CharlieDigital 4y agoThis was the first thing I tried out this morning and apparently it is not meant to work with ASP.NET (Web API in this case) and only for console applications. Explains why my container got stuck packaging Kestrel this morning.
- sylens 4y agoOh that’s disappointing. Looking through the blog post now it specifies console apps now - wonder if Web API support is coming later.
- metaltyphoon 4y agoYes, the next workload will include ASP.
- Kukumber 4y agoIt'll be ready at some point, people at AWS experimented with it, they have a sample ready: https://github.com/awslabs/dotnet-nativeaot-labs https://github.com/awslabs/dotnet-nativeaot-labs
- VancouverMan 4y agoThe article mentions things like: - "All required code is compiled and/or linked into the executable, ..." - "No JIT means no dynamic loading of arbitrary assemblies ..." - "... with everything compiled and linked into the app ..." This sounds very much like static linking, possibly with no option of dynamic linking/loading of code. Presumably this would have implications for those using LGPL-licensed .NET libraries, especially those who'd like to distributed closed-source applications AOT-compiled using this approach? Are there any commonly-used .NET libraries these days that are only LGPL-licensed? I haven't done .NET development in a decade, so I don't really know the current state of affairs.
- yread 4y agoIs there a difference between static or dynamic linking for LGPL?
- TingPing 4y agoYes. The point of LGPL in concept is there is a clear boundary where you can modify and replace code. You can't replace a statically linked library.
- jcelerier 4y agoAnd yet https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynamic https://www.gnu.org/licenses/gpl-faq.html#LGPLStaticVsDynami...
- TingPing 4y agoI don't think that conflicts with what I said. You have to be able to replace the library and them shipping linkable objects does that. Most static releases do not do this.
- jcelerier 4y agoThe proprietary ones which use LGPL libraries do - it's uncommon as it's a bit more work for the proprietary dev but it happens
- pjmlp 4y agoWhile NativeAOT is to be praised, we should not forget all the avenues that came before it. NGEN, Singularity and Midori research (whose tech landed on Windows 8 MDIL and UWP .NET Native respectively), Mono AOT. I always were the opinion that given Anders Hejlsberg background, .NET 1.0 should have had a better AOT story than NGEN.
- kcb 4y agoThey really need to extend the support time for their LTS releases. Sure, if you're developing a SaaS you can stay on top of .NET versions but it's definitely causing friction for enterprise and slow moving regulated software. .NET Framework 4.5.2 was supported for 8 years in comparison. We're about to start a project with those limitations and there really is no good choice now that .NET 6 is already a year through it's lifecycle.
- colejohnson66 4y agoIf, when publishing your app, you choose the "self-contained" mode (as opposed to "framework dependent")[a], the runtime will be bundled with your program into the executable. Then you don't need to worry about updating your client's OS. My work is using it for deployment to Linux, and it works great. [a]: Pass the `--sc true` option to `dotnet publish`: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-p...
- Arnavion 4y agoBundling the framework doesn't solve the problem of said framework being old and unsupported because it wasn't LTS.
- Jwarder 4y agoSeems like it makes the problem worse because you are then tied to a specific version at time of publishing and need to republish to get any framework patches. https://learn.microsoft.com/en-us/dotnet/core/deploying/runtime-patch-selection https://learn.microsoft.com/en-us/dotnet/core/deploying/runt...
- foepys 4y agoIndeed. Microsoft identified this as a problem as well and pushes .NET security patches via Windows Update nowadays. When using self-contained apps, you won't get these patches.
- ram4jesus 4y agoI love Java. And I'm working on c# right now at my job and I'm loving it too. This is happy news for me. When my enterprise finally adopts it 4 years from now. D:
- jp0d 4y agoI was chatting with the devs at my company and they've just migrated their code to .Net 6!
- joshschreuder 4y agoUpgrades are honestly really easy, and have been since around .NET Core 2. I have now done 2 -> 2.1 -> 2.2 -> 3 -> 3.1 -> 5 -> 6 with very little friction at all, in a fairly big web API codebase. I don't foresee any issues going from 6 -> 7. 5 -> 6 was essentially just a find and replace on TargetFramework and it all just worked.
- jp0d 4y agoAhh. I think it was quite an effort. The whole organisation really did spend some time and tested it thoroughly. I reckon it depends on the scale and complexity of the code base. I'm not a dev, I don't know enough. I'm worried about changes to Python packages breaking my code. haha.
- Iwan-Zotow 4y agoAny words on what's new in F# domain?
- delneg 4y agohttps://devblogs.microsoft.com/dotnet/announcing-fsharp-7/ https://devblogs.microsoft.com/dotnet/announcing-fsharp-7/ Written by Vlad
- Iwan-Zotow 4y agothanks!
- deleted 4y ago[deleted]
- animitronix 4y agoSo if I'm reading https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core https://dotnet.microsoft.com/en-us/platform/support/policy/d... correctly, 7 is an STA release and support for it will end before support for 6 (LTS release) ends?! Seems like the only reasons for upgrading from 6 to 7 would be an easier path (possibly) to upgrade later than going from 6 to 8, or if you really want to use something in c# 11 (https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-11 https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs...) . I remain unconvinced...
- AlfeG 4y agoI guess You need net7 of You really need every bit of performance. In our case improved hit reload is very welcome. So I guess we will incremenet our runtime.
- animitronix 4y agoCould you tell me a bit more about improved hit reload?
- EVa5I7bHFq9mnYK 4y agoChanged 6 to 7 in my project file, the program started running 10% slower ... hmm. Specifically, 5 1107ms 6 1075ms 7 1211ms Just number crunching and calling HashSet.
- neonsunset 4y agoIf you are using `time` and calculate the time from application startup to exit 0 then it is not representative of performance of the code itself - more aggressive optimization in JIT tend to have increasing cost with each release even if the people working on it try to always ensure the compilation throughput stays constant and we get more optimized JIT code per same amount of CPU work. If you would like to have representative benchmark data, I suggest relying on BenchmarkDotNet instead.
- EVa5I7bHFq9mnYK 4y agoI was using Stopwatch around the loop.
- EVa5I7bHFq9mnYK 4y agoLooking further into it (I really want my program to run faster!), looks like 7 produces unoptimized code. Could it be that it decided for me that I want faster startup vs faster code? Can I force it to turn optimizations on somehow?
- neonsunset 4y agoIf you do only a couple of iterations it will not optimize it. Loops can be now optimized in-flight thanks to on-stack replacement feature which should help with startup time and also allow to apply Tier-1 compilation with more optimizations should the loop become hot (e.g. can't elide static initialization checks if you go straight to full optimized without Tier 0 -> Tier 1). To get more representative data it is best to either use BenchmarkDotNet or profile code close to real life case.
- 4y ago