Tag Archives : Visual Studio


An Architecture Aware VsVars.ps1

Like many in the Microsoft dev community, I’m a heavy user of Visual Studio and Powershell. And so, of course, I’ve been a heavy user Chris Tavares’ vsvars32.ps1 script. However, recently I needed the ability to specify my desired processor architecture when setting up a VS command line session. Unfortunately, Chris’s script wraps vsvars32.bat which only supports generating 32-bit apps. Luckily, VC++ includes a vcvarsall.bat script that let’s you specify processor architecture. So I updated my local copy of vsvars.ps1 to use vcvarsall.bat under the hood and added an -x64 switch to enable setting up a 64-bit command line environment. Vcvarsall.bat supports a variety of additional options, but 64-bit support is all I needed so that’s all I added. I didn’t change the name of the script because there’s WAY too much muscle memory associated with typing “vsvars” to bother changing that now.

If you want it, you can get my architecture aware version of vsvars.ps1 from my OneDrive here: http://1drv.ms/1kf8g9I.


Five Minutes Past Noon Coffee 170

  • Ben Hall announcesIronEditor, a simple dev tool for IronPython and IronRuby. Pretty nice, though fairly simplistic (as Ben readily admits). For example, it doesn’t have an interactive mode, only the ability to execute scripts and direct the output to IronEditor’s output window. However, it is a good start and I’m sure it’ll just get better. One thing he’s apparently considering is a Silverlight version. (via Michael Foord)
  • Speaking of “Iron” tools, Sapphire Steel have had an IronRuby version (in alpha) of their Ruby in Steel product for several months now. I wonder if John’s had a chance to play with it.
  • Speaking of John, the ASP.NET MVC / IronRuby prototype he talked about @ TechEd is now available on ASP.NET MVC Preview 4 via Phil Haack.
  • Ted Neward has an article exploring the IronPython VS Integration sample that ships in the VS SDK. As I mentioned the other day, we’re starting working on a production quality implementation of VS Integration for IPy.
  • Ophir Kra-Oz (aka Evil Fish) blogs Python for Executives. I like his “Risk, Recruiting, Performance and Maturity” model – four boxes, perfect for keeping an executive’s attention! :) Plus Ophir has some nice things to say about IronPython. (via Michael Foord)
  • Ronnie Maor blogs an extension method for PythonEngine to make Eval simpler. I especially like how he uses string format syntax so you can dynamically generate the code to eval. I wonder what this would look like in IPy 2.0 with DLR Hosting API. (via IronPython URLs)
  • Speaking of DLR Hosting, Seshadri has another great DLR hosting post, this time hosting IPy inside of VS08 so you can script VS08 events (document saved, window created, etc) with Python.
  • Justin Etheredge has a bunch of IronRuby posts – Getting IronRuby Up and Running, Running Applications in IronRuby, Learning Ruby via IronRuby and C# Part 1. (via Sam Gentile)
  • Don Syme links to several F# related posts by Ray Vernagus, though he’s apparently also experimenting with IronRuby. I’m really interested in his Purely Functional Data Structures port to F#.
  • Speaking of F#, Brian has a teaser screenshot of F# upcoming CTP. However, he chooses the New Item dialog to tease, which looks pretty much like the current new item dialog (the new one does have fewer F# templates). However, if you look in the Solution Explorer, you’ll notice a real “References” node. No more #I/#R! Yeah!
  • The interactive graphic in Kevin Kelly’s One Machine article is fascinating. It really highlights that the vast vast vast majority of power, storage, CPU cycles and RAM come from personal computers on the edge. Even in bandwidth, where PC’s still have the highest share but it looks to be around 1/3rd, the aggregate of all edge devices (PCs, mobile phones, PDAs, etc.) still dominates the data centers.

Debugging IronPython Code in Visual Studio

In case I’m not the last person on the planet to figure this out…

  1. In VS, click on File->Open->Project/Solution or press Ctl-Shift-O
  2. Select ipy.exe from wherever you put it
  3. Right click ipy.exe in Solution Explorer and select Properties
  4. In the Command Arguments box, type “-D” (to generate debug code) and the full path to the script you want to execute. If you want to drop into interactive mode after the script executes, also include a “-i”
  5. Open the script you specified in step 4 and place breakpoints as usual
  6. Run via Debug->Start Debugging or press F5

Thanks Srivatsn for helping me out with this.


Morning Coffee 160

I took most of last week between jobs and have spent much of this week getting machines setup, access to builds, etc. Furthermore, RSS Bandit ate my feedlist and I am still soldiering on sans mobile phone so I was pretty much unconnected for about a week and a half.

IPy Stuff

  • Laurence Moroney demonstrates how to configure a web site project in VS08 to use Dynamic Silverlight’s development web server Chiron. I looked at turned it into an exported template, but I think the Start Options are stored in the suo file and I’m not sure how to include that in the template. Maybe it could be set w/ a macro or at worst a GAX recipe?
  • If you’re a regular reader, you might as well get used to the name “Michael Foord”. He’s a developer @ Resolver Systems, makers of the IPy based Resolver One app/spreadsheet hybrid I’ve written about before. He’s also the author of the upcoming IronPython in Action book and the maintainer of Planet IronPython and the IronPython Cookbook. I’m going to try very hard to only link to Michael at most once per day. Frankly, that’ll be tough.
  • Today’s Michael Foord Link: Michael turned his PyCon talk on IPy + SL2 into a series of articles entitled IronPython & Silverlight 2 Tutorial with Demos and Downloads.
  • Ken Levy (who now sits just down the hall from me) clued me into the 1.0 release of IronPython Studio, which is a free IDE based on the VS08 Shell for IronPython (based on code from the VS SDK). Big new feature in this release is support for the integrated VS08 Shell, which means it’ll snap into your existing VS08 installation (well, not express) rather than forcing you to install the 300 MB isolated shell.

Other Stuff

  • Caps had a BIG win last night when they needed it most. Now they’re tied with Carolina for the SE division lead, but they lose the tiebreaker so unfortunately, they can’t make the playoffs without help. ‘Canes have to head back home last night to play Tampa Bay, they have to win tonight and Friday to clinch. Loss in either gives the Caps control of their own destiny. Caps are only one game back of Ottawa, Boston and Philly, none of whom have played well down the stretch. It does mean I have to root for the frakking Penguins to beat Philly, twice.
  • Now that I’m in a job where I’ll be traveling occasionally, I really appreciated Scott Hanselman’s travel tips, though I’m not sure “Don’t look like a schlub” is in the cards for me.
  • Unless you’ve been living under a rock, you’re probably aware that Scott Guthrie blogged that the ASP.NET MVC Source Code is available on CodePlex. The project name is “aspnet” not “aspnetmvc” which makes me wonder if they might release the source to more ASP.NET stuff over time.
  • Speaking of Scott Guthrie, today he blogged about unit testing in SilverLight. Jeff Wilcox appears to have the definitive post on the subject, including links to the SilverLight testing framework (it’s included in the SL Controls source code release). He also provides a prebuilt “SilverLight Test” project template for easy download. Personally, I really like the in-browser test runner. I wonder how hard it would be to hook that up to DySL so you could write your tests in IPy? (given that IPy doesn’t have attributes, I’m guessing there’d be at least a bit of work involved in making this happen)
  • Speaking of SilverLight, apparently the next version of Windows Mobile (i.e. 6.1) will support it. Since I’m in the market for a new phone anyway, I’m thinking of getting one of these. Also, it’s nice to see a marketing site for WM 6.1 using Silverlight instead of Flash like WM 6.0 marketing site does.(via LiveSide)
  • Ted Neward turns the news that MSFT is releasing XAML under the OSP into a long and fascinating history lesson that is well worth the read. I’m going to skip commenting on it, beyond advising you dear reader to read this if you haven’t already, except to wonder: how many sides does a “Redmondagon” have?

Morning Coffee 156

  • My hockey team won last night 4-2. No points for me, but I was even on the night. I did spend some time in the penalty box, but I was serving a two many men on the ice bench minor. We only had nine skaters, not enough for two full lines, so I’m pretty tired today. However, I’m not as tired as I was two weeks ago – that’s a good sign.
  • Politics 2.0 watch: The Obama campain announced yesterday that they raised $55 million in donations in the month of February. That’s significantly more than Clinton ($35 million) and McCain ($12 million) combined. Even more impressive is that $45 million of that was raised online, of which $40 million were from donations of $100 or less and $22.5 million were from donations of $25 or less. I guess in Politics 2.0, individuals contribute more than online punditry and video parodies of political commercials.
  • TextGlow is a Sivlerlight 2 based Word docx file viewer, created by James Newton-King. Nice, but what I really want is “SlideGlow”, a SL2 based PPTX file viewer. (via DNK)
  • Speaking of Silverlight, Windows Live launched an experimental site called PhotoZoom which will let you create DeepZoom photo albums. (via LiveSide)
  • Charlie Calvert has created a home for Language Futures discussion on MSDN Code Gallery. If you’ll recall, back in January he asked for input on Dynamic Lookup. Now he’s looking for feedback on Call Hierarchy, a proposed VS IDE feature to help you visualize how your code flows. Great idea, but the Call Hierarchy dialog mockup isn’t very intuitive. Couldn’t we put these visualizations into the code editor window directly, like CodeRush does?
  • John Lam continues his Dynamic Silverlight series, first building a Flickr image browser in Managed JScript then showing how to integrate an IronRuby version of the Flickr image browser with an ASP.NET MVC app.
  • EdJez is inspiring. Subscribed. (via Brad Wilson)