Wisej3 and IIS Express

0
0

Hi all, for running and debugging a web application in IIS Express I have to switch the order of the target frameworks from net48;net6.0 to net6.0;net48, otherwise I get an application error: System.Runtime Version= 6.0.0.0 not found.

What is the proper way to test in IIS Express?

Cheers, Gerhard

 

 

 

  • You must to post comments
0
0

Second sample:

WisejWebPageApplicationIISExpress.zip

It’s the same project using the modified launchSettings.json as above and web.config updated for IIS Express to support .NET Core. This one can only debug .NET 6 because of the changes in web.config. It’s also possible to re-add support for running .NET 48 in launchSettings.json and duplicate web.config.

  • You must to post comments
0
0

First sample:

WisejWebPageApplicationStandard.zip

It’s the unmodified project templates for VS 2022 and Wisej 3 for .NET 6. It can run both .NET 48 and .NET 6.0 just by switching the target. See zip and images attached.

  • You must to post comments
0
0

You don’t need to do that. We’ll send two samples shortly:

1- Using the project as-is to debug at the same time net48 (iisexpress) and net6.0 (aspnet core hosting = kestrel)

2- Project modified to debug net 6.0 using iisexpress without editing the project (must use the iis aspnet core integration)

  • You must to post comments
0
0

Thank you for the pointers, though, this does not change much. Starting the app nothing happens, albeit no exception is thrown. I still have to do some research on my own. I just started using .Net Core.

For now, I start the project with net48;net6.0, open all my windows in the designer, switch to net6.0;net48 and happily code away. This way, IIS Express works and the designer continues to work.

Cheers, Gerhard

 

 

 

  • You must to post comments
0
0

I have added this to launchSettings.json

{
 "iisSettings": {
 "windowsAuthentication": false,
 "anonymousAuthentication": true,
 "iisExpress": {
 "applicationUrl": "http://localhost:54018/",
 "sslPort": 44372
 }
 },
 "profiles": {
 "IIS Express": {
 "commandName": "IISExpress",
 "launchBrowser": true,
 "environmentVariables": {
 "ASPNETCORE_ENVIRONMENT": "Development"
 }
 }
 }
}

And removed web.config. It works without altering the order of the targets. However in this case you can only run .NET 6 in IIS Express. If you keep web.config it gets confused and VS keeps adding the IIS native integration with ASP.NET Core breaking IIS Express.

That is why we have configured the Wisej 3 projects to run one profile “Application Name” that can run both .NET 48 using IIS Express and .NET 6 using the native Kestrel. ASP.NET Core apps are served through kestrel and are usually always self hosted.

When deploying in IIS you have the option to un inprocess or out of process. In both cases you need to install the ASP.NET Core IIS integration native handlers (it’s documented in MSDN in a very confusing way but you can find a good reference on our deployment book). Either way it goes through the OWIN middleware. There is no more pipeline for .NET 6.

Our project templates are configured to allow using both at the same time.

Please note that if the IIS ASP.NET Core handlers are added to web.config (and VS has a tendency to do it by itself) then IIS (including Express) cannot use .NET 48 anymore

 

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.