Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 12 17:02
    dotnet-maestro[bot] synchronize #43128
  • Aug 12 17:02

    dotnet-maestro[bot] on 3.1-3439de4c-39c3-4b07-bc3d-bce67e3bd10c

    Update dependencies from https:… (compare)

  • Aug 12 17:02
    dotnet-maestro[bot] edited #43128
  • Aug 12 16:17
    Ettores88 starred dotnet/corefx
  • Aug 12 04:21
    yuxiangwende starred dotnet/corefx
  • Aug 09 22:21

    carlossanlop on 3.1

    Merge in 'release/3.1' changes Merge in 'release/3.1' changes Forbid XML external entity reso… and 3 more (compare)

  • Aug 09 22:21
    carlossanlop closed #43156
  • Aug 09 18:18
    vseanreesermsft opened #43156
  • Aug 09 15:52

    dotnet-bot on v3.1.28

    Merge in 'release/3.1' changes Merge in 'release/3.1' changes Forbid XML external entity reso… and 1 more (compare)

  • Aug 06 12:08
    SHILY-PROJECT starred dotnet/corefx
  • Aug 06 08:43
    kilesduli starred dotnet/corefx
  • Aug 06 00:50
    byIbrahimAli starred dotnet/corefx
  • Aug 05 15:53
    mmitche closed #43100
  • Aug 05 08:39

    ViktorHofer on 3.1

    Update branding to 3.1.29 (#431… (compare)

  • Aug 05 08:39
    ViktorHofer closed #43155
  • Aug 04 22:33
    ericstj review_requested #43155
  • Aug 04 22:32
    ericstj review_requested #43155
  • Aug 04 22:32
    ericstj review_requested #43155
  • Aug 04 12:22
  • Aug 04 12:22
    zhcom888 starred dotnet/corefx
akima15
@akima15

Can someone please explain what things you guys take into consideration when deciding whether to use[MethodImpl(MethodImplOptions.AggressiveInlining)]?

It's used very often in methods that are extremely small and I'd expect the JIT to inline them always but I'm guessing that there are cases where this wouldn't happen without this attribute? perhaps if its called many times in a single method?

akima15
@akima15

I have a method whos code size in IL is 34 bytes that is getting inlined but another simliar one that isnt getting inlined and its IL code size is 30 bytes. So far my conclusion seems to be the JIT is dumb and I should use this attribute in most cases where I want performance.

I need an expert to shime in and please correct me if I'm wrong.

HaloFour
@HaloFour
JIT takes a lot more into consideration than just code size
Matthijs ter Woord
@mterwoord
i'd definitely say jit is very smart, but it can be wrong on occasion
Note that it isn't exhaustive and for the classic framework
Matthijs ter Woord
@mterwoord
you want it to inline the Reset1 method? i think there's hardly anything to gain here
only overhead is 1 call and 1 return
akima15
@akima15
@mterwoord Unnecessary overhead and it takes more ASM instructions than would otherwise be required if the call to Reset1() was inlined. Usually not inlining a method and instead calling it gets you less executable binary bloat.
The point is that the JIT doesnt seem very smart here.
In fact the Reset1() method doesnt use anything that is listed in the article given by @jspuij which would 100% prevent the JIT from inlining it.
masonwheeler
@masonwheeler
File an issue then.
akima15
@akima15

Ok but I asked because I needed an answer for now not for .NET 7.

There also should be a way to JIT compile a specific method without calling it or all methods at runtime.

I've tried Ready2Run but everything runs slower and NativeAOT is still experimental.
Paul M Cohen
@paul1956
What do I need to access System.Windows.Automation from a Core project? I am porting from Framework. I am looking to use AutomationElement and Connection and the Framework Interop NuGet package I was using doesn’t support Core.
it looks to be part of wpf
Paul M Cohen
@paul1956
But my app is WinForms. Is there any way to still use it? I have same issue with Media API.
Joseph Musser
@jnm2
@paul1956 You need to set <UseWPF>true</UseWPF> in your project file along with <UseWindowsForms>true</UseWindowsForms> if you want to access WPF assemblies.
Paul M Cohen
@paul1956
Thanks no idea you could specify both.
Matthijs ter Woord
@mterwoord
I'm pretty sure it's a bit off topic here, but: We're having difficulties with our linux build agent. suddenly it cannot download tasks. timeouts occur after 20 minutes. Anyone experienceing this?
Paul M Cohen
@paul1956
I just installed VS 16.9 Preview 4 and it can't find 5.0.100-alpha1-015536 SDK. when I look in C:\Program Files (x86)\dotnet\sdk it only has Rollback. Where can I download the SDK?
dotnet --list-sdks list none
Paul M Cohen
@paul1956
The one I want to use is 5.0.200-preview.21079.7
When I run dotnet --list-sdks I get below
5.0.103 [C:\Program Files (x86)\dotnet\sdk]
Light
@PylotLight
Looking for the correct room for WinUi3, attempting to update UI thread, but having trouble.
Michael Fry
@nth-commit
Does anyone know of any good docs on writing custom LINQ implementations. It's really hard to search for because everyone's asking about IEnumerables when talking about LINQ. There's definitely some magic there that I've been prodding away at, and would really benefit from a proper understanding of. The only thing I've found which mentioned this was like "see an example of this in the AsEnumerable docs". The AsEnumerable() docs: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.asenumerable?view=net-5.0
8 replies
masonwheeler
@masonwheeler
If you want a good explanation of how Linq works, look up Jon Skeet's Edulinq series of blog posts.
1 reply
Isobel Cullen
@isobel-cullen
I cannot believe that this use-case is unsupported: https://dotnetfiddle.net/elSDwz (System.Text.Json + Record Types)
Michał Zegan
@webczat
seems to be the reference handler limitation, not actual not supporting of records
and probably generally affects things with parameterized constructors.pretty sure non positional records would work.
Paul M Cohen
@paul1956
What do I need to do to try .Net 6 preview I am running Microsoft Visual Studio Community 2019 Preview
Version 16.10.0 Preview 1.0 and don't see any option for .Net 6.
Joe4evr
@Joe4evr
@paul1956 just grab the SDK from here: https://dotnet.microsoft.com/download/dotnet/6.0
Igor Velikorossov
@RussKie
You can create a net5.0 project, then having installed net6.0 preview, update the project file to "net6.0-windows"
Joe4evr
@Joe4evr
I'm waiting for preview3 to drop before playing around with it (:
p3 has a new API that I've been dying to use
Paul M Cohen
@paul1956

When I try .Net6 it does not like below, ApplyHighDpiModeEventArgs and ApplyHighDpiMode are not found

Private Sub MyApplication_ApplyHighDpiMode(sender As Object, e As My.ApplyHighDpiModeEventArgs) Handles Me.ApplyHighDpiMode
        e.HighDpiMode = HighDpiMode.PerMonitorV2
End Sub

I don't see anything about WinForms in the what's new or any breaking changes

alealpha2000
@alealpha2000
hello? can i ask a question about regex in .net?
i use this regex AA\((.+?)\) to get the text inside the parenthesis after AA in AA(text)-AB(text2)-
however if I have this AA()-AB(text2) then the regex matches the whole string and i get )-AB(text2 extracted out. how can i get an empty result if there is no text in the parenthesis after AA?
masonwheeler
@masonwheeler
Some people, when faced with a problem, think "I know, I'll use regular expressions!" Now they have two problems.
It's an old joke, but it's a joke that exists for a reason.
Joseph Musser
@jnm2
I used regex today, feels like it ended with zero problems.
Igor Velikorossov
@RussKie
You need to use non-greedy search
Joseph Musser
@jnm2
If possible, use [^)] rather than .. Regex is not good at handling distinctions in level of nesting though IIRC.
So e.g. AA\([^)]*\)
@RussKie It looks like they are already using non-greedy search because of the .+?
@alealpha2000 Is maybe part of the problem if you want to match a zero length that you are using + instead of *?
alealpha2000
@alealpha2000

So e.g. AA\([^)]*\)

that seems to work. thanks!