This tool works great, but you are running the powershell runspace in the AppDomain.
This causes issues for me because I am developing a powershell module and testing it in the IDE with a script.
So I right click the script and click execute, and it works great. But then I can build my powershell module because Visual Studio has the dll open still because the dll wasn't unloaded at the end of the script.
I suggest that you Create a separate app domain for the script to run in and when it's done (error and all) unload it.
Why don't you just have the executor run in a console app and use ProcessStartInfo to run it hidden and get it's output to write to the VS output window? You could compile the console app for x64 and x32 and make the right click execute script have two options "Execute 32" or "Execute 64"
This is actually a problem for me as well. :) The problem is with debugging. I need to have access to the variables, breakpoints and debugger state. My hope is to take advantage of the new remote debugging to work around this issue. It's certainly on my radar.
I have just installed it to my VS2013, I closed VS and launched it again. But I got
Failed to initialize PowerShell Tools for Visual Studio.System.IO.FileNotFoundException: Could not load file or assembly 'System.Management.Automation, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Management.Automation, Version=18.104.22.168, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
After I installed Windows Management Framework 4.0 and launch my VS2013 again, I got another error message.
Failed to initialize PowerShell Tools for Visual Studio.System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ComponentModel.Composition.ImportCardinalityMismatchException: No exports were found that match the constraint:
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T](String contractName)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at Microsoft.VisualStudio.Shell.Package.GetDialogPage(Type dialogPageType)
When I place a break point on a line and I start with F5, I get the following results:
[ERROR] C:\Users\xxxxx\documents\visual studio 2013\Projects\PowerShell Script Project1\PowerShell Script Project1\Script.ps1 : Could not load type 'System.Management.Automation.DebuggerCommandResults' f
[ERROR] rom assembly 'System.Management.Automation, Version=22.214.171.124, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
[ERROR] At line:1 char:1
[ERROR] + . 'C:\Users\xxxxx\documents\visual studio 2013\Projects\PowerShell Script Pr ...
[ERROR] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR] + CategoryInfo : NotSpecified: (:) [Script.ps1], TypeLoadException
[ERROR] + FullyQualifiedErrorId : System.TypeLoadException,Script.ps1
I'm using VS2013 community edition and have installed the "dog food" version of the tools, as I am having troubles with debugging and break points. When I debug a script and check the environment
[environment]::Is64BitProcess the result is "true"
How do I set the environment to be 32bit when debugging?
(when I used the previous Poshtools it was 32 bit)
I suppose it's not compatible yet with the Community edition? Is that planned?
For now I get this error message when VS starts and this module is installed (I tried to re-install it to make sure, but the same error comes back):
"Failed to initialize PowerShell Tools for Visual
Studio.System.IO.FileNotFoundException: Could not load file or assembly 'System.Management.Automation, Version=126.96.36.199 [...]"
Unfortunately I can't put the screenshot here, so it's hosted at this URL:
Visual Studio Community 2013
Version 12.0.31101.00 Update 4.
I use community edition and Windows 7 sp1. And Management Framework 4. But I get this error message: The extension 'Powershell tools for visual studio 2013' requires a version of the .NET Framework that is not installed'..
I have framework 4.5. It says nothing in the logs about what version is missing. You have any idea what Framework version I'm missing?
I tried to install this today and got this error:
3/17/2015 9:44:02 AM - Searching for applicable products...
3/17/2015 9:44:02 AM - Found installed product - Microsoft Visual Studio Express 2013 for Windows Desktop
3/17/2015 9:44:02 AM - Found installed product - Global Location
3/17/2015 9:44:02 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
Is Microsoft Visual Studio Express 2013 for Windows Desktop not supported?
I installed PowerShell Tools for Visual Studio 2013 (Powershell version 4). I created a powerShell Script Project and I can only debug the script code if the project was opened at the first time. The farther debugging will never hit the breakpoint. I have to restart vs 2013 to get debugging work only one time. Please help me out, thanks.
I think it's awesome and thank you for making it!
I've tried it for the last couple of days but there are few issues on Visual Studio 2013 Community Edition.
I need to scroll down and up again to get things highlighted again.
I don't get the intellisense immediately.
I feel like ISE is much smarter when it comes to intellisense but maybe it's just because it doesn't work correctly for me.
Can you guys give some of the latest builds a stab? We have been working a lot with some of issues with editing experience. These are still pre-release but might fix some of the issues you are mentioning.
I've been running the dev branch build for a day now. I am no longer seeing the highlighting problem. Intellisense seems pretty responsive, and Intellisense no longer gets stuck on the screen (and becomes unremovable).
However, the dev build changed the syntax highlighting for me. In the new highlighting all variables are colored Red. The same red that an error is usually colored with. I find this to be disconcerting when working. Is there away to change the syntax highlighting back?
I was writing "Fix" in a comment of a ps1 file and got this error when I pressed the "x" key.
I'm using VS12 update 4
<source>Editor or Editor Extension</source>
à Microsoft.VisualStudio.Utilities.PropertyCollection.GetProperty(Object key)
à PowerShellTools.Classification.PowerShellClassifier.AddTokenClassifications(ITextBuffer buffer, SnapshotSpan span, List`1 classifications, Nullable`1 lastClassificationSpan, IClassificationType gapType)
à PowerShellTools.Classification.PowerShellClassifier.VirtualGetClassificationSpans(SnapshotSpan span)
à PowerShellTools.Classification.Classifier.GetClassificationSpans(SnapshotSpan span)
Interesting. I can't say I've run into this exact issue but I would recommend taking a look at some of the test builds we have been producing to see if it's fixed.
Maybe this has already been address but certain drop-downs do not close. For instance, I can do a Get-ChildItem c:\users and I cannot get the drop-down to close. Any ideas? Great extension aside from this issue. Thanks!