Tag Archives: Visual Studio

The Visual Studio Experimental Instance

Working on some addins lately has taught me a few really useful tricks about debugging in Visual Studio. I’ll update this post over time.

The Experimental Instance

Very useful to know – the experimental instance loads its extensions from a special folder, and debugging extensions drops them there. The location is:

%UserProfile%\AppData\Local\Microsoft\VisualStudio\10.0Exp\Extensions\

Deployment Projects in Visual Studio 2012

As part of Microsoft’s ongoing campaign to reduce the usability of their tools for anyone who isn’t working in exactly the way they want, Visual Studio 2012 no longer comes with the ability to create setup and deployment projects.

This is a pretty serious change. For anyone who is developing client applications, then an installer is pretty critical. Now the feature set in the VS deployment projects was fairly small – they were aimed towards making pretty basic, lean installers. And that was fine. That was what we needed it for. Installers for utility apps, installers for basic client applications, installers for testing out projects on other machines before we went to more advanced systems.

What’s truly disappointing is the lack of alternatives. Rather suspiciously there are links to InstallShield projects in Visual Studio now.

If you’ve never worked with InstallShield before then I envy you. It is truly awful – a maintainance nightmare combined with a user interface that makes creating basic installers baffling.

So Visual Studio now has no deployment projects. You can try using the free edition of InstallShield, but be ready for a world of pain. Also, considering the vast complexity of the UI, the free edition is incredibly limited in functionality – for example you cannot create ‘features’ (i.e. the chunks of functionality that you offer as an optional feature for an installation).

Example of Time Wasted

My Switch addin for Visual Studio adds a button to the UI that lets you switch between related files (cpp/h, aspx/aspx.cs etc etc).

I need to update it to work in Visual Studio 2012. I cannot develop VS 2012 addin projects in Visual Studio 2010. With a sigh I move the solution into 2012. I write the 2012 addin. The deployment project doesn’t load (as expected). I build the binaries into specific locations. I open the project in 2010. The 2012 addin doesn’t load (as expected). However, the setup project will not build due to an error when ‘updating dependencies’. This project has no dependencies – it builds from specific locations.

So now to release a version of Switch that supports VS2012, I need to use InstallShield. InstallShield’s free edition doesn’t support features – therefore I have to install Switch for 2008, 2010 and 2012 for everyone, always, regardless of whether they have it. A two hour update is not looking possible now. I don’t have the time to waste trying to bring back functionality I already had and have to move onto other work.

Conclusion

Thanks MS for removing this critical feature, and replacing it with an essentially useless and overly complicated alternative.

Please remember, we’ve paid for Visual Studio – not for a vessel to host adverts to other products. We had the functionality before, now its gone – replaced by links to an expensive (and frankly crap) suite of tools that aren’t suitable. Why has this happened? The cynical part of me thinks there’s some kind of deal going on between MS and InstallShield (well of course there is), and we’re suffering from it.

Hit the uservoice page here: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3041773-bring-back-the-basic-setup-and-deployment-project- to try and vote for it to go back in.

 

Go Offline Extension for Visual Studio 2010

Such a useful extension that I just had to big it up – the Go Offline extension adds the following menu item:

File>Source Control>Go Offline

http://visualstudiogallery.msdn.microsoft.com/425f09d8-d070-4ab1-84c1-68fa326190f4?SRC=Home

If you use TFS in a big environment, sometimes this can save a stack of time. Thanks to Bernhard Tschirren for taking the time to write this and share it!

Come on MS – Improve MFC

Loads of developers still use MFC. OK – if you’re writing a new project, MFC would not be a great choice. But what if you’re maintaining a 1.5 million line MFC app? 

MFC support in Visual Studio has barely improved since VC++ 6.0 – in fact its got worse. Their cursory attempt to show an effort by adding support for the Ribbon Control with the MFC feature pack was not enough. Why can we still not properly use tab controls in the dialog editor?

Those who use MFC are probably supporting big enterprise applications – for a long time now we’ve been neglected. Please vote for more MFC support in Visual Studio Uservoice below:

http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2782934-improve-mfc

Will they listen? Chances are not – unless lots of people vote. But I’d really like to see some effort on this, it’s a technology still used by many.

It would be interesting to see a survey of enterprise applications – and what they’re written in. It’d be interesting to then compare this to how well MS support that platform. MS will put lots of efforts into what they think that developers should be using – but how well are they supporting their real customers who are creating real products?

Switch

I have written the second article in my series on Extending Visual Studio. In this article I describe how to create a Visual Studio Addin that allows you to switch between cpp/h files, WinForms code and designer, XAML and codebehind and so on. You can find the article on the CodeProject here:

http://www.codeproject.com/Articles/324611/Extending-Visual-Studio-Part-2-Creating-Addins 

There is also a direct download page on this blog, you can get Switch from dwmkerr.com by going here:

http://www.dwmkerr.com/page/Switch.aspx

How to Debug a Visual Studio Extension

Here are a few tips for debugging Visual Studio Extensions.

Visual Studio 2008/2010

If you need to debug your Visual Studio extension, you may find that Visual Studio itself locks it. This is a real drag – to resolve this issue, add the following as a pre-build step:

if exist "$(TargetPath).locked" del "$(TargetPath).locked"
if not exist "$(TargetPath).locked" if exist "$(TargetPath)" 
move "$(TargetPath)" "$(TargetPath).locked"

This will ensure the locked file is moved out of the way first – very useful!

Visual Studio 2010

Every time I do a clean checkout of one of my projects, it seems to lose the ability to be run in the Experimental mode of visual studio. Here’s a quick tip – if you lose the ability to debug your visual studio extension, make sure you have the ‘Debug’ tab of your project set up as below:

Specifically with the external program set as visual studio and the command line arguments as /rootsuffix exp. This will run your extension in the Experimental Instance of Visual Studio.