Recent Comments



Ana Helena
Monday

re: Programmatically Opening Windows Terminal in a Specific Folder

Hi Rick. Thanks for the post!

What if I wanted to open a new tab using a path? Can you help me with this? For instance, I have a folder D:/dev and I'd like to open this open using a profile to open in a new tab.

Thanks in advance. Ana


jamal kaksouri
Monday

re: Strongly Typed Configuration Settings in ASP.NET Core

In startup class using strongly type

usage:

services.Configure<MySettings>(a => Configuration.GetSection(nameof(ConnectionStrings)).Bind(a));

instead of...

services.Configure<MySettings>(Configuration.GetSection("MySettings"));

Rick Strahl
September 15, 2021

re: Taking the new Chromium WebView2 Control for a Spin in .NET - Part 1

@Rajesh - don't think there's UI activation available for that. You can use window.find() in JavaScript, but it looks like the showDialog parameter is not supported by Edge.


Rajesh Kumar
September 13, 2021

re: Taking the new Chromium WebView2 Control for a Spin in .NET - Part 1

Is there a way to show the Edge Find window. I have a WPF tree on left and Edge control on right, when we search we filter the tree based on search phrase. When we display the corresponding HTML page based on Tree View Node selected, I want to show the html page on Edge with phrase tokens highlighted.

Since I did not find APIs for this, simplest thought was to do SendKeys and that also did not work. Any thougts?


Rick Strahl
September 05, 2021

re: Variable Scoping in Anonymous Delegates in C#

@David - probably not a big concern. But from a pure code gen perspective using the static variable removes one dependency on the generated wrapper class, so results in slightly less code and one less assignment in executing code (although it's entirely possible that the optimizer might figure that out on its own during compilation - you'd have to look of the compiled Release IL to know for sure).


David Clarke
September 02, 2021

re: Variable Scoping in Anonymous Delegates in C#

So a question re coding style. I have an Action delegate that references a static variable. The method where the delegate is called assigns that static variable to a local variable:

var appContext = AppContext.Current;

InvokeSomeAction(() =>
{
    if (AppContext.Current.SessionInfo.IsSomeFlag ||
        appContext.SessionInfo.IsSomeFlag)
    {
        // which condition is better?
    }
});

Is there a reason to use one over the other or is it just a matter of preference?


Aravind S
August 31, 2021

re: Hosting SignalR under SSL/https

Hi Rick

Myself Aravind from India. I have created certificate using Opc.Ua.Generator and did port binding for my application certificate. Initially I was getting certificate issues on the client side hub saying "The underline connection was closed.Could not establish true relationship for SSL/TLS secure channel." I got this issue fixed by changing the Certificate name to Host name of the system which is running SignalR service. After this i was able to setup chat and communicate successfully with 3 systems in the same domain but this didn't work out when I took the setup to a different domain. I ended up in the former error and applying of the Host name didn't work out for the other network. Is there any problem in the fix I have applied or any alternate solution is there, Please let me know.


b.pell
August 28, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

First thing, thanks for your articles. They're always a good read.

I thought I'd share in case it's useful to anyone. This is probably hackery but for personal projects, whatever duct tape works in a reasonable time and doesn't crash is thumbs up for me. I'm using a WebView2 and then I have a code editor (AvalonEdit ❀️) which runs either Lua (via NLua) or JavaScript (via Jint). I pass some C# interop objects to scripting environments to allow them to interact with the WebView2 or whatever C# I want them to get to (their calls from those scripts to WebView2 are sync). What I ended up doing was creating a thread safe script result list (script result has an id, the result and if it's still running or not), so WPF would call ExecuteScriptAsync, immediately return an id that represents the script result and then the Jint/Lua can wait for that id to complete. If you do anything beyond trivial the Jint can be weird to read because it's JS executed in Jint then calling JS executed in WebView2 (a few times I forgot context I was in).

C#

public int ExecuteScript(string javaScript)
{
    var result = new ScriptResult()
    {
        Id = GetNextId(),
        IsRunning = true
    };

    ScriptResults.Add(result);

    Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(async () =>
    {
        try
        {
             result.Result = await _mainWindow.Edge.ExecuteScriptAsync(javaScript);
        }
        catch
        {
            // TODO: Pass exception info back
            result.IsRunning = false;
        }
        finally
        {
            result.IsRunning = false;
        }
    }));

    return result.Id;
}

Jint

// Call to WebView2
var id = edge.ExecuteScript("Math.abs(-5)");

// These script.LogInfo's are interop calls that write to a WPF control
// via the Dispatcher to the UI.
script.LogInfo("Waiting for id " + id);

var isRunning = true;

while (isRunning) {
        var result = edge.GetResult(id)
        isRunning = result.IsRunning;
	
        if (isRunning == false) {
            script.LogInfo("Result found!");
            buf = result.Result;
        }
	
        script.Pause(10)
}

script.LogInfo("Result is => " + buf);

My result is (noting I ate 10ms with the pause):

8/28/2021 2:12:36 PM: [Jint] [Info] Waiting for id 2
8/28/2021 2:12:36 PM: [Jint] [Info] Result found!
8/28/2021 2:12:36 PM: [Jint] [Info] Result is => 5
8/28/2021 2:12:36 PM: [MainWindow] [Info] Script complete in 34ms

Caveat, I'm by no means a WPF expert, so far I've had no dead locks with this approach (this is what I came up with after an hour of trying to wrangle the WebView2 to make sync calls).


Frank
August 27, 2021

re: Strongly Typed Configuration Settings in ASP.NET Core

Searching again on the web for an answer to a question, just as I have been doing for decades, and once again I run into that same old smiley face, Rick Strahl, who now seems so familiar to me it's like meeting an old friend. I might have to take the family on holiday from Europe to Hawaii just to go and see you in person.


Menaka
August 18, 2021

re: Using .NET Standard with Full Framework .NET

Hi Rick, I'm currently converting existing .Net applications to .Net5. We have some applications which use 3rd party DLLs which use WCF. This gives much trouble with ServiceModel libraries.

Whats is the best approach to use those DLLs(in .NET with specially WCF related stuffs) from .Netstandard?

Thanks you very much


Honza
August 18, 2021

re: Async/Await Calls Gotcha with the CSharp ? Null Propagator

I got here from the MM conversion post (thanks a lot for a great article BTW).

A few thoughts:

  • Anyone using <Nullable>enabled</Nullable> does not need to worry about awaiting nulls, the compiler will check and warn you about it.
  • Do prefer to call ConfigureAwait(false) in suitable locations, this would produce a compile-time error (since the returned Nullable<ConfiguredTaskAwaitable> does not have an extension method GetAwaiter and it being a struct thus produces the error. (I guess this won't apply to this conversion situation where you're re-writing code in bulk, but I thought it was worth mentioning.) I would recommend using an analyzer for situations where ConfigureAwait is not called πŸ˜‰ (you'd get a bunch more warnings though)
  • Problems with ConfigureAwait is that the call becomes much more ugly await (foo?.Bar() ?? Task.CompletedTask).ConfigureAwait(false);
  • Using a ValueTask may produce even more warnings/hints
  • I would refrain from using EnsureAwaitable as it is prone to mistakes.

Ajay Gote
August 14, 2021

re: Role based JWT Tokens in ASP.NET Core APIs

Great article! It helped a lot to understand each step in Authentication/Authorization in one place. Thanks a lot!


Rick Strahl
August 07, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

@Richard - yeah that's useful, but limited since it only applies to events that you define and explicitly expose. Personally I use events less and less and Action or Func<T> in my own definitions so when I need event handling it's usually from the framework such as UI events which are unfortunately only using void.


Andreas
August 07, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Thanks, Rick, for this great article. Everytime when I'm searching because of a coding problem and West-Wind shows up in the results, it's a "Yeah" and zero hesitation to click the link. Amazing work! It was about time for me to say so.


Ralph Welz
August 06, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Rick, you seem to be right πŸ˜ƒ At least the legacy webbrowser control works with the current Windows 11 22000.120 build within a VirtualBox. But the changeover to the WebView2 Control is being tackled anyway πŸ˜ƒ Regards Ralph


Christopher Steinfeldt
August 06, 2021

re: IIS and ASP.NET Core Rewrite Rules for Static Files and Html 5 Routing

I have found a solution that does not require registration of all handlers. Also the solution does not allow access to the root directory. The solution is basically based on rewrite-rules. My folders are as following:

rootfolder
-web.config
-appsettings.json
-bin
-client

Files in the root folder are not accessible from external. Only the client folder is accessible.

First I register the dotnet handler under "dotnet":

      <add name="aspNetCore" path="dotnet" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

Additionally, in the dotnet application, the basepath must be modified accordingly:

      app.UsePathBase("/dotnet");

The rest are three RewriteRules:

First sends all requests to api and swagger to dotnet/api and dotnet/swagger

        <rule name="dotnet" stopProcessing="true">
          <match url="^(swagger|api).*" />
          <action type="Rewrite" url="dotnet/{R:0}" />
        </rule>

Second sends all other requests to the client folder.

        <rule name="mapToClient">
          <match url=".*" />
          <action type="Rewrite" url="Client/{R:0}" />
        </rule>

The Last is only neccessary to support html5 pushstate.

        <rule name="Root" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="Client/Index.html" />
        </rule>

This should solve all problems and is much easier than reregistering all the handlers and shouldn't have much sideeffects.


Richard
August 05, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

If you're defining the events yourself, you may be able to use the "DeferredEvents" NuGet package by Pedro Lamas to make it easier to interact with async event handlers.

https://github.com/PedroLamas/DeferredEvents


CatatanDroid
August 03, 2021

re: A HighlightJs Copy Code Badge Component

Thank you so much for this guide, finally i can add hljs and copy bagde to my blog guide script. this really essential for me because i use anti right click and anti menu script to prevent copy paste content. Regards


Rick Strahl
August 02, 2021

re: Publish Individual Files to your Server in Visual Studio 2012.2

@Alex - it's still there. The default key to publish the current editor file or file(s) selected in the Solution explorer is `alt-p-;' - I use it all the time.

Although that might also depend on the type of project that you're in, but it works for (old) Web Projects, Web Deploy Projects and ASP.NET Core Web Projects.

+++ Rick ---


Alex
August 02, 2021

re: Publish Individual Files to your Server in Visual Studio 2012.2

Hi there,

I can't see the Publish Selected Files optin in the context menu anymore in VS2019. Looking for a solution I do not see anything but answers from MS stating that it's fixed, but actually it's not. Even by pressing the shortcut keys Alt+`, Alt+P, it states "publishing selected files is not available".

Anyone knows how to get it back?

Thanks...Alex.


zero.one.girl
July 28, 2021

re: Blank Zero Values in .NET Number Format Strings

This just saved me so much data wrangling time & effort, not to mention in a beautifully succinct fashion... thank YOU!


Cameron Wilby
July 27, 2021

re: Updating Assembly Redirects with NuGet

You know, I've probably stumbled on your site about 3 times over the last 10 years, and each time has been a huge value add.

Thank you for writing!


Rick Strahl
July 22, 2021

re: Role based JWT Tokens in ASP.NET Core APIs

@Nash - sure you can create a class that assigns all the default functions etc. and then package that up as a NuGet package.

But - these are configuration values, and they are meant to be customized for each application, so I'm not sure that that is really useful other than saving some typing or cut and paste. Once you start account for generic behavior I don't think there's a good way to abstract the abstraction πŸ˜„


Frank Paynter
July 22, 2021

re: Fixing Visual Studio Intellisense Errors

Thanks - nuking the .vs folder worked for me when intellisense could no longer connect a line number to a function name


Nash
July 22, 2021

re: Role based JWT Tokens in ASP.NET Core APIs

Is there a way to package (nuget?) the jwt validation so that the same policies can be used in individual APIs without rewriting all of the policies?


Ralph Welz
July 21, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Dear @Rick,

Thanks for your feedback. Shortly after writing my last post, I have seen that you have discussed this issue at your message board some years ago (discussion is still going on there πŸ˜ƒ ). There is still some confusion because there is hardly any information about it. But now I'll wait and see and should a change be necessary, I have the appropriate blueprints in the drawer. Yesterday I designed a first prototype, of course nothing half or whole, but I will probably be able to migrate most of the current functionality if needed (but not all and some major code adjustments will be needed).

Your second article in particular was of great help to me, as the interaction between the desktop app and the web browser (Webview2) is crucial.

In my case the webbrowser view is needed for some map based desktop apps. Using a Javascript library (leaftlet) you can realise a kind of google maps desktop (standalone) app. There isn't any modern 'HTML' functionality needed, but well proved javascript functions that the old webbrowser control can deal with (nearly perfect). I'm using this control at a smaller independent desktop app (too many users to give up on this app, but not enough to completely rebuild it from the scratch). But there are some commercial requests, cause some - so called 'Flottensoftware' (apps for forwarding agencies) - is utilzing the webbrowser control for this task too.

The Internet Explorer and the associated Active X (COM) control gave us developers headaches again and again, but when it worked, it was really great treasure box. When it comes to COM automation, hardly anyone can hold a candle to MS. Today there are of course other approaches, but I am not aware of any good working alternative in the Win32 world. And overflying some of your posts, you're always dealing with the webview2 adaption (like flickering issues for example).

However, the air for C ++ programmers is likely to get thinner and thinner, but it seems that the concepts you mentioned can also be implemented with C ++ (https://docs.microsoft.com/de-de/microsoft-edge/webview2/get- started / win32).

So a lot is happening and who knows, maybe MS will make a tough cut after all to give developers of outdated software a few new projects. It's just a new technology and Microsoft also seems to need doing a lot of fine-tuning at his time. The distribution thing still needs also some finetuning πŸ˜ƒ

Maintaining backward compatibility has always been a big feature of MS. After I had to work on some Android projects, I really appreciate that, because in Android you keep stumbling into the so called deprecate trap, nearly everyting is deprecated in the Android world β†’ so Android developers needs a lot of help of the google search machine. Maybe this is the secret of their business model and I'm glad that MS did not make it with Bing) πŸ˜ƒ

Regards Ralph


Rick Strahl
July 21, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

@Ralph - I don't think there's going to be a problem with existing functionality in the WebBrowser control. I think it's the IE application that's getting pulled out of the OS, but the browser engine is likely to stay for a long time as there are so many apps - including many Microsoft apps (think Outlook) depend on it. It's just not going to get updated in any way. So if it works now with what you're doing it'll continue to.

The concern of course is that you need functionality that the IE engine can't render and there's more and more of that. If you're building apps that use internal content (which is mostly what I do) this isn't much of a problem, but if you interface with external arbitrary HTML and Web sites, then there's lots of stuff that no longer works with even IE11.

I have several old (FoxPro) apps that run using the WebBrowser control and they all use local content and continue to chugg along. I don't see that breaking anytime soon - there are no easy alternatives there in ActiveX space (UI .NET interop isn't much of an option).


Ralph Welz
July 21, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Thanks for this great article.

I am also currently in the process of making the jump from TWebbrowser to WebView2, because it looks like MS is now serious about shutting down the old Internet Explorer.

Unfortunately there is hardly any information (on the internet) regarding a migration strategy from the 'outdated' webbrowser ActiveX Control β†’ Webview2.

MS is also very silent, well knowing that the end of Internet Explorer - and the probably associated non-functioning of the old web browser control - will bring down the one or the other application, who are utilizing the webbrowser control.

Your article is a very good start, even if I am investigating for an older Delphi application. Embarcadero has now also taken up a TEdgeBrowser Webview2 component in Delphi 10.4 Sydney, but I will probably do the adaptation in C# because it seems this will become a major conversion (many older approaches won't work with the Webview2 component).

I would like to see some more support/clarification from Microsoft regarding this issue. Especially how it will behave with the web browser control under Windows 11 (or Windows 10 after the cut), but I think, it's will be dead and some access violations will arise. But again, your article is a good start regarding this task.

Regards from Frankfurt (have seen you live on the stage in our youth in Hanau πŸ˜ƒ )


Tylor Pater
July 20, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Hey, great writeup explaining the different features! I'm trying to call some C# from JavaScript and decided to use the basic message interop, but I'm wondering where the WebMessage class you reference in the code is found, or if it is just a placeholder. I looked through the sample and couldn't find any reference to it.

Thanks!


Rick Strahl
July 20, 2021

re: Rendering ASP.NET MVC Views to String

@Alexandre - This code won't work with .NET Core. There are similar APIs that do this but the syntax is different.


ALEXANDRE KONIOUKHOV
July 19, 2021

re: Rendering ASP.NET MVC Views to String

just wondering, does it work in ASP.NET 5? Have Web API and need to return html string from View.


Mehdi
July 12, 2021

re: Accepting Raw Request Body Content with ASP.NET Web API

it does not work for me I use .net 5 web api Error: "The JSON value could not be converted to System.String. Path: $ | LineNumber: 0 | BytePositionInLine: 1." Do you have any solutions


Roman
July 11, 2021

re: PC and Mac with single Mouse and Keyboard Setup on Dual 4k Screens

This is a great post, just what I wanted know, I'm a developer too and have to use both worlds MacOs and Windows/ Macbook and Laptop so I have like a month trying to figure out how can achieve a configuration that allows me to have the less peripherals and more productive and fast way to switch between machines, I really appreciate you sharing for this approach, thank you.


Rick Strahl
July 09, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

@Dalibor - The hanging becomes and issue whenever multiple tasks are waiting on the same Synchronization Context. It's more pronounced in UI applications because of the UI thread that's firing potentially many tasks simultaneously and they're all synchronizing back to the UI thread.

In server applications the context synchronizes back to the incoming request thread. In classic ASP.NET that was a single request thread, but in Core that thread doesn't have to the stay the same as the HttpContext is not tied to the thread which makes it less of a problem, but can still lock up.


Rick Strahl
July 09, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

@Michael - yeah that makes sense: The caller (the event invoker) is not calling the event with await so the task is not awaited and immediately completes while the code within the event runs in the background.

I think this is the exact problem that is causing some of my loading inconsistencies that I'm seeing.


Michael Rumpler
July 09, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

Unfortunately making an event handler async void does not always give the expected results. For me the big problem was, when the caller expects the handler to be done after the event was invoked. This is not the case when you have an await in your event handler. Then SomeEvent.Invoke() only executes the part before the first await.

This can easily be seen in this example:

    public class MyEventArgs : EventArgs
    {
        public int Result { get; set; }
    }

    public event EventHandler<MyEventArgs> SomeEvent;

    public void Run()
    {
        SomeEvent += Program_SomeEvent;

        var e = new MyEventArgs();
        Console.WriteLine($"Invoking SomeEvent with Result {e.Result}");
        SomeEvent.Invoke(this, e);
        Console.WriteLine($"Result={e.Result}");

        Task.Delay(1000).Wait();
        Console.WriteLine($"End.");
    }

    private async void Program_SomeEvent(object sender, MyEventArgs e)
    {
        Console.WriteLine($"In Program_SomeEvent. Awaiting something...");
        await Task.Delay(500);
        Console.WriteLine($"After await, setting Result to 1.");
        e.Result = 1;
    }

This program prints:

Invoking SomeEvent with Result 0
In Program_SomeEvent. Awaiting something...
Result=0
After await, setting Result to 1.
End.

In these cases I had to use .GetAwaiter().GetResult() in the event handler. But as you said, this is prone to deadlocks.


rich
July 08, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

How excellent is this post. My prediction: this time next year it will be the all time best-performing post on your blog!

I have struggled with much of the same thing since I first got handed an all-async third party API to work with back in 2016.

Only difference, I just thought my struggles were just lack of knowledge.

Now I see, it wasn't me, it was the platform!

Thanks Rick!


Daniel
July 08, 2021

re: Adventures in .NET Core SDK Installation: Missing SDKs and 32 bit vs 64 bit

To fix it without re-installing, just move the x86 dotnet path below the x64 dito in the PATH environment variable.

win β†’ "edit system environment variables" (or something similar) β†’ Environment Variables β†’ System variables β†’ select PATH β†’ edit β†’

find the "C:\Program Files (x86)\dotnet" path and move it below the "C:\Program Files\dotnet" path.


Dalibor ČarapiΔ‡
July 08, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

Just curious but are the problems in making sync over async work related to continuations being run on the UI thread (SynchronizationContext) or is there some other issue? I would think that these problems (using the Task.Result) would not occur in non-GUI code.


Rob Kent
July 08, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

Thanks for the write-up. We were lucky in that we had only just started our WPF app when async/await arrived so we quickly changed to using it (almost) everywhere. However, we still experienced occasional mysterious bugs which we refer to as 'Clearys', after Stephen Cleary who wrote some great articles and SO responses on this subject. We managed to get rid of the deadlocks but the inverse problem was calling methods that were now async void and the calling code continued and expected the called code to have happened, for example:

MyEditorProperty = BindEditor(); // Whoops - this got converted to async void
MyEditorProperty.DoSomething();  // Bug - MyEditorProperty is sometimes not set yet (Cleary)

We started out by having inline exception handlers around 'fire and forget' async code and then I discovered you could use the TaskScheduler.UnobservedTaskException at the top of your app, so we have this in the App.cs file:

var currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += CurrentDomainOnUnhandledException;
Dispatcher.UnhandledException += OnDispatcherUnhandledException;
TaskScheduler.UnobservedTaskException += (s, e) => Current.Dispatcher.Invoke(() => Handle(e.Exception));

public void Handle(Exception exception)
{
    if (exception is AggregateException aggregateException)
    {
        exception = aggregateException.Flatten().InnerException;
    }
    ...

However, there are still situations where we have to call async code from sync code and get the result, so we use one of your methods above. But it is easier to convert everything and have 'turtles all the way down' (or with unit tests, 'mock turtles all the way down'). Because of this, we dropped the xxxAsync naming conventions because async is now the norm.

We also had to convert all our affected tests as they were finishing before the code we were calling, ha. Luckily NUnit has good support for async testing plus it detects when the test should be using 'async Task' (other testing frameworks are available).


Frank Th. van de Ven
July 07, 2021

re: Thoughts on Async/Await Conversion in a Desktop App

This is a great informative post and I enjoyed reading it. I recommend developers in a similar situation to study it thoroughly, it will save you a lot of time.

I went through exactly the same experience, where I first tried the ".Result" route in an attempt to keep running my existing synchronous code unmodified. I ran into the same problems. If took a while for my brain to accept implementing await in the whole call chain from now on. The biggest worry was a negative impact on performance. But it never became an issue.


Ragnorok
July 06, 2021

re: Accepting Raw Request Body Content in ASP.NET Core API Controllers

You, Mr Strahl, are awesome. I've been scouring the web for days trying to discover how this works, to migrate a "framework" system to "core". I knew it was simple, but finding what simple thing would make their brain-dead automagic happy was apparently a state secret. Thanks for blowing the whistle! (wink) In case it helps anyone else:

[HttpPost]
public async Task<string> Post()
{
   using(StreamReader body = new StreamReader(Request.Body, Encoding.UTF8)) {
      System.Xml.Linq.XElement xlog = System.Xml.Linq.XElement.Parse(await body.ReadToEndAsync());
   }
}

That's all it takes to get parse XML from a non-form POST. The string return isn't required, that's detritus from me fiddling with it.


Alex
July 06, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Thanks a lot Rick. Guessing still the one and only comprehensive and concise article about WebView2. Coming from WebrowserControl working at edge-mode actually using IE11. My main reason for heading towards EDGE/chromium based WebView2 control: User that click on links within an iframed Youtube video always starting a blank window using IE11 loosing all "edgy" - optimized disign quirks. Also animated and iframed SVG's e.g. created by inkscape focussed "Sozi" presentation tool now nicely perform within WebView2. Greetings from Munich to Maui.


Rick Strahl
July 02, 2021

re: ASP.NET Core In Process Hosting on IIS with ASP.NET Core

@varun - yes in a different AppPool - always. You can also get an ASP.NET Core application to run in the same AppPool as an ASP.NET classic application, but there can only be one ASP.NET Core application in any given AppPool (I think that will also change in 6.0 along with a few other improvements including shadow copied installs that can detect binary changes and restart).


varun
July 02, 2021

re: ASP.NET Core In Process Hosting on IIS with ASP.NET Core

hey Rick, Very Naive question. Can an IIS host ASP.Net core app alongside ASP.Net App in a different APP Pool ?


Lorenzo Gonzalez
June 30, 2021

re: Chromium WebView2 Control and .NET to JavaScript Interop - Part 2

Just wanted to say thank you for such an informative, thorough, and well-written article. Really helped me speed through my project considering this is still such a new bit of SDK and the Microsoft-provided documentation is pretty thin and hard to dig through.


Wynand Murray
June 28, 2021

re: Role based JWT Tokens in ASP.NET Core APIs

Yet another simple, clear example. Thank you, works like a charm.


Thomas Haukland
June 23, 2021

re: Role based JWT Tokens in ASP.NET Core APIs

Thanks, this worked like a charm!

I scrapped my identityserver attempt(which worked, but token endpoint required "client_id" which the old clients didnt provide(and isnt required as per the spec...))

One little thing: I think you have a typo in your helper class, replace "uniqueKey" with "signingKey" and it works fine


Ben
June 21, 2021

re: Locked Files When Publishing .NET Core Apps to IIS with WebDeploy

Well done! Also I added the tag "VersionNumber" to generate right FileVersion and ProductVersion in my case else my dlls seems not having right custom number.