New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PowerShell: can't load Microsoft.PowerShell.Utility. #377
Comments
Hello @Ba4bes, Are you getting this error when you run the function app using the Core Tools? Or when running the Core Tools via VSCode? Could you please send me the the following outputs? PS C:\> func --version
2.7.1948
PS C:\> dotnet --info .NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.100\
Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db
.NET Core SDKs installed:
1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk]
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.508 [C:\Program Files\dotnet\sdk]
2.1.509 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.109 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
PS C:\> Thanks, |
Hi @Francisco-Gamino , thank you for your time! C:\> func --version
2.7.1948
C:\> dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.100\
Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db
.NET Core SDKs installed:
2.1.607 [C:\Program Files\dotnet\sdk]
2.2.207 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download In an effort to get this to work I had removed all the .NET Core SDKs (and the Function Core tools) and start reinstalling them as needed, these 3 versions seemed to be the ones, but maybe I would need something else. |
Thank you @Ba4bes for the additional information. Could you please try the following?
Your VSCode should look like this:
Thanks, |
Hello @Ba4bes, I am going to be out of the office for a couple of weeks, and I will not be able to look at this until I come back on 1/7/20. Thanks, |
hi @Francisco-Gamino , I did all the steps that you described, got all the output you described. But after step 3 the same thing happens. I have the feeling the function isn't even hit, so it doesn't hit Wait-Debugger. What I do see, is that even if I put it in pwsh (which already is the default, it switches to the PowerShell integrated Console before func is called. I have now found that if I have a 3rd pwsh-window, it returns to that window when the function app crashes. So it doesn't give that error. Another thing I noticed is that there is a warning about dotnet not being in c:\program files(x86)\dotnet, so that Path will be used. When I run So I'm not sure if this is a problem with dotnet or VSCode or... |
Alright I have made process. This might have been because I played around with the dotnet installation, but I got it working in VSCode now when I use Func Host Start. @Francisco-Gamino thank you for your help. I guess this issue needs to be in another place. Do you have an idea if this could be the PowerShell extension or the Azure Functions Extension? (Or am I completely off?) |
Hi @Ba4bes, apologies for the delay, but I was OOF on vacation. Sounds like this is an issue related to If this does not fix the issue, let's setup a call to debug this. What's you availability this week? Thanks, |
Hi @Ba4bes, What version of pwsh are you using? You can get this information by running Are you available for a videocall? If you are, Here is my availability in Pacific Standard Time: Let me know what day and time works for you. Please share an email where I can send the meeting request. Thanks, |
Powershell version:
Powershell extension in vscode
Azure Functions Extension in vscode
I'm in Central European Time, so there are not a lot of time zone overlaps. Would between 11AM and 1PM PST work for you today (Thursday)? |
Hello @Ba4bes, I could do 11 am to 12 pm today. Let me know if you are available. Also, what's your email address? If this does not work. Are you available tomorrow 1/10? If you are, this is my availability: 9am-12pm and 3-4 pm. |
Hey @Francisco-Gamino , |
Hi @Ba4bes -- 9 am works. Please send me your email address via private message. |
Great! I can't send you a message though unless you follow me or you start the conversation 😉 |
Hey @Ba4bes, I sent you a private message. Please reply. I will talk to you tomorrow at 9 am. Have a good night. |
This issue is not caused by the Core Tools, so moving to the PowerShell Worker for tracking. |
After extensive troubleshooting we have found no way to fix this issue, but also no way to reproduce. |
You are welcome @Ba4bes. I am glad the debugging issue was issue was resolved. Please do not hesitate to reach out if you ever need help for PowerShell in Functions. Thanks, |
I have the same error as mentioned in this issue.
[Process:4688]: PS C:> The module 'Microsoft.PowerShell.Utility' could not be loaded. For more information, run 'Import-Module Microsoft.PowerShell.Utility'. At line:0 char:0
[Process:4688]: PS C:> Debug-Runspace : The term 'Debug-Runspace' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
It started somewhere when I installed the latest Core Tools.
I use version 2.7.1948 through Chocolatey
I have .net Core SDK version 2.1, 2.2 and 3.1
I have two different VSCode environments (regular and insiders), PowerShell preview and regular, PowerShell extension preview and regular, it really doesn't seem to matter what combination I pick.
(all of these are on the latest versions)
Also tried reinstalling .net Core SDKs and Azure Core Function tools. No luck so far.
The text was updated successfully, but these errors were encountered: