Unable to find type [Microsoft.AspNetCore.Http.CookieOptions]

the header loads, but i get this error before any part of the body loads. I’m not doing anything fancy, just some New-UDCard, New-UDRow… looks more like a configuration thing. Any idea? I can’t find another topic about it, which is a little surprising.

Unable to find type [Microsoft.AspNetCore.Http.CookieOptions]

If you have asp .net core bundle installed, then I’m not sure, if not it’s probably that.
Otherwise, it might be helpful to know more about your setup:

Where are you hosting your dash, how etc? IIS/Azure/WinService
PS version, 5.1 or core 6.1+
Have you made sure all prereqs are installed? .net4.7.2, if using IIS: asp.net core hosting bundle, web socket protocol
Maybe even show your code if this is just a single one file dashboard?

I have all the pre-reqs installed and my code works on a VM at the office, but at home it doesn’t and configuration appears to be identical on the IIS side.

I have it narrowed down to this code (when commented everything works)

$Ascripts = get-childitem -path C:\ScheduledTasks -filter *.ps1 -name

foreach ($script in $Ascripts){

$help = get-help C:\ScheduledTasks$script | Out-String

New-UDCollapsible -Items {

New-UDCollapsibleItem -Title “$script” -Icon arrow_circle_right -Content {

New-UDHtml -Markup “
$help

}

}

}

I tried your code and was able to replicate the issue. It’s not a dashboard related problem as I took out all UD code and got the same exception.
The error as you say is coming from your code above.

I tried it like this, removing all UD elements:
$scriptpath=“C:\temp\scriptpath”

$Ascripts = get-childitem -path $scriptpath -filter *.ps1 -name

foreach ($script in $Ascripts){

    $help = get-help $scriptpath$script | Out-String

}

This returns the same error you describe.
If I now change the following line:
$help = get-help $scriptpath$script | Out-String
To this:
$help = get-help "$scriptpath\$script" | Out-String
No error is returned.

I’ve not looked into the exact detail on what causes the error, I’m just playing around here.
I imagine its to do with the path as mentioned, I would do a couple of things here, run each bit of code independantly in your ISE, confirm that it works locally on your PC first, as the environment may behave differently from your VM.

Secondly, you may wish to do a test-path in an if statement to ensure the file exists prior to running get-help on it or you could use a try catch statement to skip or ignore certain exceptions, that way if there’s only one file causing this error, you’ll still get output from all the others.