I don't know what else to test hence my question here.
The goal is to continue using my Visual Studio project set to<Project Sdk="Microsoft.NET.Sdk.Web"> and being able to obtain a Powershell session via the Powershell.SDK nuget package.
I noticed that running "powerShell.Invoke()" with a Visual studio project set to <Project Sdk="Microsoft.NET.Sdk"> will give me a session as expected. However using Sdk.Web always returns an error => "An error occured that Powershell could not handle".
I even added a project reference to a console application in order to get the session working but the result is the same as explained above.
Am I doing something wrong or is there any workaround?
Could I change my .net web application to a console app and still host it on IIS?
Thank you.