FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Generate the correct reference assembly for `Microsoft.PowerShell.ConsoleHost` NuGet package by daxian-dbw · Pull Request #11545 · PowerShell/PowerShell · GitHub

Generate the correct reference assembly for Microsoft.PowerShell.ConsoleHost NuGet package - #11545

Merged
Aditya Patwardhan (adityapatwardhan) merged 3 commits into
PowerShell:masterfrom
daxian-dbw:refs
Jan 13, 2020
Merged

Generate the correct reference assembly for Microsoft.PowerShell.ConsoleHost NuGet package#11545
Aditya Patwardhan (adityapatwardhan) merged 3 commits into
PowerShell:masterfrom
daxian-dbw:refs

Conversation

Dongbo Wang (daxian-dbw) commented Jan 9, 2020
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Fix #9734

Update the packaging script to generate the right reference assembly for Microsoft.PowerShell.ConsoleHost.dll and use that for the NuGet packages Microsoft.PowerShell.ConsoleHost and Microsoft.PowerShell.SDK.

With this fix, the following C# program will build and run as long as it references the Microsoft.PowerShell.SDK package.

using System;
using System.Management.Automation.Runspaces;
using Microsoft.PowerShell;

namespace testConsoleRef
{
    class Program
    {
        static void Main(string[] args)
        {
            InitialSessionState config = InitialSessionState.CreateDefault();
            config.StartupScripts.Add(@"New-TemporaryFile");

            int ret = ConsoleShell.Start(config, "Hello", "", new string[] { "-noprofile", "-c", "exit 23" });
            Console.WriteLine(ret);
        }
    }
}

PR Context

Before this fix, the reference assembly for Microsoft.PowerShell.ConsoleHost.dll is not included in Microsoft.PowerShell.SDK package, so you cannot use ConsoleShell in the above program.

PR Checklist

Dongbo Wang (daxian-dbw) added this to the GA-consider milestone Jan 9, 2020
Dongbo Wang (daxian-dbw) added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jan 9, 2020

Copy link
Copy Markdown

🎉v7.0.0-rc.2 has been released which incorporates this pull request.:tada:

Handy links:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request - Bring back ConsoleShell functionallity

3 participants


Back | FazBrowse Home | New Git URL