The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,046 other followers

Archive for the ‘.NET’ Category

Running Visual Studio Code on macOS from the terminal

Posted by jpluimers on 2020/07/30

For running Visual Studio Code from the terminal, you need to do a few extra steps as from Running Visual Studio Code on macOS: Get Visual Studio Code up and running on Mac (macOS):

Launching from the Command Line

You can also run VS Code from the terminal by typing ‘code’ after adding it to the path:

  1. Launch VS Code.
  2. Open the Command Palette (⇧⌘P) and type ‘shell command’ to find the Shell Command: Install ‘code’ command in PATH command.

macOS shell commands

  • Restart the terminal for the new $PATH value to take effect. You’ll be able to type ‘code .’ in any folder to start editing files in that folder.

Note: If you still have the old code alias in your .bash_profile (or equivalent) from an early VS Code version, remove it and replace it by executing the Shell Command: Install ‘code’ command in PATH command.

To manually add VS Code to your path:

cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

This is what the code command is and does:

$ which code
/usr/local/bin/code
$ ls -alh `which code`
lrwxr-xr-x  1 jeroenp  admin    68B Apr 16 13:24 /usr/local/bin/code -> /Applications/Visual Studio Code.app/Contents/Resources/app/bin/code
$ cat `which code`
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

function realpath() { /usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
ELECTRON="$CONTENTS/MacOS/Electron"
CLI="$CONTENTS/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?

–jeroen

 

Posted in Development, Software Development, Visual Studio and tools | Leave a Comment »

SharpLab

Posted by jpluimers on 2020/07/24

This is amazing stuff: it runs your C# code through a specific version (git branch) of the C# compiler!

C#/VB/F# compiler playground. Not a Shark lab.

Source: SharpLab

Example: https://sharplab.io/#v2:EYLgtghgzgLgpgJwD4AEAMACFBGA3AWACh0tsA6AGQEsA7ARzIFEAPABwTiiioHsaoCxAMxYATBgDCAHgAqAZR4BXBAGM4AGgwyAIpxgA+DAHcAFojhbdsDCAw04RgBQBKDAG8iGL1hEt2nbj4pFABWWQVlNU0dPX1DADEeHhdPbzSAXkMwHgATOAAbDEy7B0s9F0E0lF82Di5eGmCw+SVVDTLYOIwAIQgEFMI0jKzcgqLDeyMOmHcAX0FZoA===

Via:

–jeroen

Posted in .NET, C#, Development, Software Development | Leave a Comment »

Is WCF faster than ASP.NET Core? Of course not! Or is it?

Posted by jpluimers on 2020/07/14

Interesting:

How does WCF, a 13-year-old mega-abstraction framework hold up against the modern, lean, ASP.NET Core? You’d be surprised.

Source: [WayBackIs WCF faster than ASP.NET Core? Of course not! Or is it?

Via: [WayBack] Interesting read! – Ondrej Kelle – Google+

–jeroen

Posted in .NET, Development, Software Development | Leave a Comment »

Nick Craver on Twitter: “I see a lot of MyEnum.Member.ToString() in code reviews across various projects – instead you should use: nameof(MyEnum.Member)”

Posted by jpluimers on 2020/06/25

I love nameof (and wish many more languages had a similar feature), but since it got introduced so late in the C# language, there is still a lot of old idiom going around. Luckily most of that are not string literals, but you see the occasional reminder to get rid of that cruft: [WayBack] Nick Craver on Twitter: “I see a lot of MyEnum.Member.ToString() in code reviews across various projects – instead you should use: nameof(MyEnum.Member)”.

Luckily, there is a Roslyn analyser for it: [WayBack] Andy Edinborough on Twitter: “Roslynator: https://t.co/3LDUG9WRvE… “.

[WayBack] GitHub – JosefPihrt/Roslynator: A collection of 190+ analyzers and 190+ refactorings for C#, powered by Roslyn.

[WayBack] Antão Almada on Twitter: “I use Enums.NET https://t.co/YaIZWpYVxJ… “ which is a cool library that I’ve used a lot:

[WayBack] GitHub – TylerBrinkley/Enums.NET: Enums.NET is a high-performance type-safe .NET enum utility library

–jeroen

Read the rest of this entry »

Posted in .NET, C#, Development, Software Development | Leave a Comment »

.NET Rocks: How do you do concurrency?

Posted by jpluimers on 2020/06/23

Since it was quite a while ago I wrote heavily concurrent code in .NET, I wanted to know about the starte of the art.

This pod cast and the book discussed in it helped a lot: [WayBackHow do you do concurrency? Carl and Richard talk to Riccardo Terrell about his book on Concurrency in .NET. https://www.manning.com/books/concurrency-i… – .NET Rocks! – Google+

Links referenced:

–jeroen

Posted in .NET, Development, Multi-Threading / Concurrency, Software Development | Leave a Comment »

 
%d bloggers like this: