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
SDK: Missing MMI DLL when publishing SCD targeting portable win RIDs. #7886
Comments
@jay-rad If you see the MMI package, it has native assemblies that are specific to the Windows OS version. Namely, |
@adityapatwardhan Thank you for clearing this up for me. :) And thanks to everyone for all your time and hard work! |
@SteveL-MSFT @adityapatwardhan I see that PowerShell Core is becoming more popular and as result there are more such questions. Developers need documentation how to use the SDK. (Maybe WiKi?) |
@iSazonov that is a great point. Opened MicrosoftDocs/PowerShell-Docs#2967 |
@adityapatwardhan can you explain what the solution is? |
This issue explains that PowerShell core is not portable cross-platform. Is there a plan to make it portable? That is the basic expectation from the .net core. When I run the published application on the server, I get the error
|
@ttutisani If this is happening on Windows Server 2008, dotnet does not support it. Minimum supported version in Windows Server 2008 R2 SP1. Supported OS Also, for PowerShell 7, the minimum supported OS by dotnet is Windows Server 2012 R2 SP1 |
The server has Currently, I have |
Can you please clarify this?
Do you mean that PowerShell 7 is a dependency for the .NET core app that uses |
I would recommend the |
The latest release 7.0.0-preview.1 is built on |
To add to that, I have another app running on this same server just fine. .net core self-contained publish, targeting win-x64 runtime from publishing settings. However, this time the .net core app uses PowerShell class as described above and it throws the mentioned error during the run, as I explained before. |
You should be still able to use RuntimeIdentifier as |
Here it is:
|
You know what, disregard my complaints. It started working. I just set the value back to Win-x64 and then again back to Win7-x64. I think the problem was that first I published with Win10-x64 and then immediately switched to the Win7-x64 setting. Anyway, it works flawlessly as a self-contained deployment. Thanks for your help!!! |
Glad to hear it works! |
I'm trying to publish a .NET Core v2.1.4 console app that uses the Microsoft.PowerShell.SDK to invoke PS Core commands. The Microsoft.Management.Infrastructure.dll is missing from the output directory after doing a publish targeting portable Windows RIDs (win-x64 or win-x86). Everything is fine when targeting Linux portable.
I tried including the MMI NuGet package explicitly, but that didn't help either.
I Binged around to try to figure out if portable Windows deployments simply don't work with MMI or PowerShell SDK, but I couldn't find anything.
Steps to reproduce
Using this demo project...
ConsoleTest.zip
Publish using...
dotnet publish -o .\publish -r win-x64
Run .\publish\ConsoleTest.exe and observe error.
Microsoft.Management.Infrastructure.dll is missing in the output directory.
Now publish using...
dotnet publish -o .\publish -r win10-x64
Run .\publish\ConsoleTest.exe and observe success.
Microsoft.Management.Infrastructure.dll is present in the output directory.
Expected behavior
A self-contained deployment targeting Windows portable should (I think?) have all its dependencies included. It appears to be missing Microsoft.Management.Infrastructure.dll.
Actual behavior
The below error is generated when trying to run an SCD targeting Windows.
Environment data
The text was updated successfully, but these errors were encountered: