Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 23 21:14
    jonfortescue assigned #28206
  • Sep 23 21:13
    jonfortescue review_requested #28206
  • Sep 23 21:13
    jonfortescue opened #28206
  • Sep 23 21:13
    jonfortescue review_requested #28206
  • Sep 23 21:13
    jonfortescue review_requested #28206
  • Sep 23 21:13
    jonfortescue review_requested #28206
  • Sep 22 20:28
    rwkarg commented #8942
  • Sep 20 18:52
    zaytsev-victor removed as member
  • Sep 20 18:52
    yvanin removed as member
  • Sep 20 18:52
    WinCPP removed as member
  • Sep 20 18:52
    Suchiman removed as member
  • Sep 20 18:52
    poizan42 removed as member
  • Sep 20 18:52
    noamyogev84 removed as member
  • Sep 20 18:52
    mattwarren removed as member
  • Sep 20 18:52
    MarcoRossignoli removed as member
  • Sep 20 18:52
    lkts removed as member
  • Sep 20 18:52
    kbaladurin removed as member
  • Sep 20 18:52
    kant2002 removed as member
  • Sep 20 18:52
    jnm2 removed as member
  • Sep 20 18:52
    filipnavara removed as member
Stephen A. Imhoff
@Clockwork-Muse
If you're writing an API that calls another API, you're just writing an API.
CyrusNajmabadi
@CyrusNajmabadi
yeah. it seems pretty trivial here. you can always 'leak' out data you have access to yourself
technically a ran a business that did this (legally), until the terms of the API i was calling changed.
i called into another company's API and repacked it for my own company's needs.
sounds like one api calling another :)
Stephen A. Imhoff
@Clockwork-Muse
Because what you're really wanting to do is (mostly) serve gmail.com, except swapping out the relevant authentication.
I'm not as up on this, but my gut would be that unless you swapped out all the underlying calls to the api, you'd end up leaking the real authentication tokens. So you're still looking at api->api behavior, just now the web pages you serve call api.gregg instead of api.gmail
necrypted
@necrypted:matrix.org
[m]
hi
um anybody here know c++
im trying to learn ;w;
i pretty much only know how define, headers, and functions (ex: type name = thing) work
Stephen A. Imhoff
@Clockwork-Muse
@necrypted:matrix.org - some of us do, but this channel is primarily about the development of the runtime for C#.
If you have a specific question it might get answered because we're generally nice, but otherwise you'd be better off asking on StackOverflow (if it's the kind of question they'd handle), or finding a relevant discord or something.
Otherwise you'd be better off following general tutorials and just plain web searches.
oscrodave
@oscrodave

Are there any good patterns in C# or .NET 5 for building a dynamic update function based on a JSON response for a class? Doing this manually at the moment and get the feeling there's a better way.

Essentially, I'm retrieving a JSON list of key/value pairs and manually switching on the keys to update the corresponding config value.

Example:

foreach(var kvPair in response){
 switch(kvPair.key){
   case "Option1":  {
        _config.update(o => { o.Option1 = kvPair.value});
    }
   case "Option2":  {
        _config.update(o => { o.Option2 = kvPair.value});
    }
 }
}
It would be nice if I could just automatically map the key /value pair to the corresponding option and option value
I'd like to avoid using reflection if possible
Stephen A. Imhoff
@Clockwork-Muse
@oscrodave - At minimum source generators would help. That said, especially if this is actually for config, there's probably an existing library for this.
oscrodave
@oscrodave
I've been meaning to get into generators, will def have to check them out
patrick sabah
@SabahPatrick_twitter
hey
i have a .net core application which runs a backgroundservice. i can run this app using dotnet run or via visual studio but when i pack it as executable, it just waits on black console screen
i couldn't find the reason.. could you help me
oscrodave
@oscrodave
What logger are you using?
If you're using something like Serilog you could add a file logging sink and log the Generic Host setup steps
That way you have output that isn't tied to the console window
Alternatively, how are you packing the executable?
Hugh Gleaves
@Korporal
I'm just curious but why is there a Windows and a Unix implementation of this:
Surely pointer arithmetic, padding etc is straightforward enough to be the same on both platforms?
CyrusNajmabadi
@CyrusNajmabadi
The code seems to doc why it's different:
        // Unlike the C standard and POSIX, Windows does not requires size to be a multiple of alignment. However, we do want an "empty" allocation for zero
You could always start a GitHub discussion on this topic. I can ping tanner about it.
Hugh Gleaves
@Korporal
Thanks, it's of some interest to me as I want to rewrite a C API (that was written for Windows) in C# (and that's why I moan about that odd CLR bug where it can't load types) so I'm certainly interested in what they've done here.
Hugh Gleaves
@Korporal
Specifically this CLR bug FYI: dotnet/runtime#6924
My specific example (but the bug is the same bug) was: dotnet/roslyn#35324
Gavin Henry
@ghenry
hi all
I'm looking to build something the hooks into Windows to make numbers clickable
Not tel:// prefixes, but I think a TAPI API?
I'm not sure what to Google, but like how Teams and others allow you to click a number and register an app to intercept those clicks. Not just in Outlook or a web browser
What should I be searching for? Thanks.
I want it to sit in the system tray too. I've done that with Electron, but I want to do this right.
Hugh Gleaves
@Korporal
This is great, we have code that I'm migrating to netstandard 2.0, that code refers to System.Web.HttpContext.Current and I'm stuck, this it seems does not exist in netstandard 2.0, oh the fun...
JoreNoe
@JoraNoe
Hello
Andrew Hill
@AartBluestoke

https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABAJgEYBYAKGIGYACMhgYQYG8aHunGBLAHYYGAFSgBPABQBKDlx4LBw3AFd8AXgAMAbnkLuGCZ2r7TDAGbQGkpQz5btdgDzlNOuwGoP0vWdOr8D3U+XRMzAF8GMGwMMAALdnDfBWSeYgB2BgDQhSTqGl96OyEGADkIMSlZYz9bAIdU00soa1t7dz4XN0c+Lx8wv381IJDGpkzs3zyacKA=

    public int Try() {
        int sum=0;
        try{
            for (int i=0; i<100; i++)
                sum+=i;
        } catch{}

        return sum;
    }


    public int NoTry() {
        int sum=0;
            for (int i=0; i<100; i++)
                sum+=i;
        return sum;
    }

adding a try{...}catch{} around a trivial for loop can strongly affect its optimisation ; is this expected?
it's a few more mov's, and the value is no longer in a register, it's about 3x as slow. (originally asked in dotnet/roslyn about this time, but they suggest it's a runtime issue)

LiteWait
@LiteWait
Inherited a non-WCF ASP.Net app with SOAP APIs built in 2009. Wondering how difficult it will be to modernize it to ASP.Net Core...
Only about 30 simple services using .Net 4 Framework.
Stephen A. Imhoff
@Clockwork-Muse
@LiteWait - Do one at a time?
That aside, most of the internal code of the service (that is, once the request hits the endpoint) should be source-compatible, so that helps.
Steve
@hez2010
@AartBluestoke this one is especially tracked in dotnet/runtime#35923
Christian Broomfield
@SoulBeaver
Hey everyone! I'm a JVM dev that's trying to get into .net development and I'm just trying to get a feel for where the community is and gathers. Is this the most active place for discussions? :)
Joe4evr
@Joe4evr
@SoulBeaver I'd recommend the Discord as its way more active https://aka.ms/dotnet-discord
Christian Broomfield
@SoulBeaver
Awesome, thanks a lot!