-
Notifications
You must be signed in to change notification settings - Fork 1
Unable to bundle ps1 scripts #16
Comments
What version of PoshTools and PoshTools pro are you running? I think you'll need to upgrade PoshTools based on the screenshot. |
I am running PoshTools 3.0.552 and PoshTool Pro 1.4.0 |
Try updating to PoshTools 3.1.620. |
Thanks! Doing the upgrade worked. Now I see the option to bundle the scripts and have checked it. What do I do next or where do I go to see my bundled ps1 file? Is it just the wpfWindow1.xaml.ps1? I ran wpfWindow1.xaml.ps1 from the ise and it worked fine, but if I try launching the same script with a regular powershell window I get a bunch of red errors like: Unable to find type [Windows.Markup.XamlReader] |
@hou8182 That seems like a bug. I'm surprised this is the first I've heard of it. Can you try adding this to the beginning of your script?
|
@adamdriscoll I was running into this same issue and that fixed the problem for me. Thanks. |
Thanks! Adding [System.Reflection.Assembly]::LoadWithPartialName("PresentationFramework") to the top of the script worked. Now I'm curious how to get it to run without the separate powershell console window in the background. This may be another bug: When adding a background image to a winform, it shows in my design window and when running the program from VS, but only when selecting a local resource file. If I choose to import a project resource file, the background image of my window in VS remains blank. When I package the form as an exe, I get this message: *Notice that the console window still shows in the background, even though I selected the option to hide the console window. Also, when running the build from VS, I always get the popup saying "This project is out of date. PowerShellProject4 Debug Any CPU". Is there a reason for this? |
@hou8182 Could you please open a separate issue for the background? I will have to look into that. As for hiding the console window, can you upload your PSSProj file? Seems like that setting isn't being saved or something. And for the project is out of date issue, that's a problem with PoshTools: https://github.com/adamdriscoll/poshtools/issues/536 |
I am unable to find a way to bundle my ps1 scripts after creating my wpf application. I am running Win10, VS2017, and have installed .NET Core SDK 1.1.7 and .NET Framework 4.6.2 Developer Pack. I tried right clicking on my WPF Powershell Project and going to Properties, but I still did not see the option to bundle there as in this documentation:
https://poshtools.com/docs/posh-pro-tools/bundling-packaging-msbuild/
Instead, these are the options I see:
Side note - If I right click on my xaml window, I get a menu option to package as an executable, and this works when I run it, but it also pops up a blank powershell window in the background, is there a way to create the exe without that additional window in the background and also to create an custom icon for it?
The text was updated successfully, but these errors were encountered: