Rss Feed
Tweeter button
Facebook button
Technorati button
Reddit button
Myspace button
Linkedin button
Webonews button
Delicious button
Digg button
Flickr button
Stumbleupon button
Newsvine button

Category: productivity

Cleaning up Visual Studio

By , March 19, 2018 12:33 pm

Why would you ever need a tool to clean up Visual Studio? Doesn’t Visual Studio have a built in “clean” mode that cleans your build directories?

Yes, it does, but that only cleans the file created by compiling and linking your software. Visual Studio also creates other files. How do you get rid of those files? Look them up, then search for them manually? That’s going to be time consuming.

Why would you even want to delete these extra files?

We’ve also seen Visual Studio crash from time to time. Sometimes it’s a plugin or extension gone astray, but other times it’s when you do something harmless like load a project or workspace or solution. What we found was that in many cases, just deleting the extra files would prevent future crashes.

So we wrote Visual Studio Project Cleaner to do that. The first version of the tool was written to work with Visual Studio 6, but we’ve updated it to also cleanup so of the files created by the newer versions of Visual Studio, Visual Lint and Visual Studio Project Fixer.


What type of file can we clean?

  • aps. Last Resource editor state.
  • bak. Backup file.
  • bsc. Source browser database.
  • dbg. Debugging information.
  • exp. Exports file.
  • idb. Minimum rebuild linker file.
  • ilk. Incremental linker file.
  • ipch. Incremental precompiled header file.
  • lastbuildstate. Build helper.
  • log. Build log.
  • map. Linker MAP file.
  • ncb. Intellisense database.
  • obj. Object file.
  • opt. Visual Studio options.
  • pch. Pre-compiled header file.
  • res. Compiled resource script.
  • sbr. Source browser information.
  • sdf. Intellisense database.
  • tlog. Depdenency file information.

We can also clean the following file types (these are disabled by default).

  • lib. Library file.
  • dll. Dynamic Link Library.
  • exe. Executable.
  • pdb. Program database.
  • old. Visual Studio upgrade files.
  • Visual Lint files in .visualint directories.
  • Visual Studio Project Fixer backup files (*.vcxproj-YYY-MM-DD-HH-MM-SS)


Clean your Visual Studio

We’ve been using Visual Studio Project Cleaner for years to clean unwanted files. It turns a tedious job into a simple and easy job.

Clean your files today with Visual Studio Project Cleaner.

Improving how we build projects and solutions

By , March 12, 2018 12:01 pm

The problem with Solutions

If you’re working with just one solution and the projects it contains Microsoft Visual Studio is a good tool for managing the builds. Except that it won’t necessarily build the projects in the right order, forcing you to make multiple build passes to get a built solution.

But what if you’re working with many solutions?

What if some of the projects in the solutions have identical project names, even though they are different projects? You can’t merge these into one mega solution so that you can build everything at once because the project names will clash.

Another problem with solutions is that the projects in the solution do not necessarily get built in the optimum order. A project that depends on another project may be built before that project dependency is satisfied. This forces you to build the solution multiple times until all dependencies are satisfied.

What if there was a better way to manage your builds? What if there was a better way to automate your builds?

Born from a real need

At Software Verify we have a code base of several million lines of C++, plus some C, assembler and C#. Looking at the Visual Studio Project Builder display I can see we have 28 solutions, with 217 projects, giving us a total of 962 different project configurations to complete a build. (The actual number is higher than this because it doesn’t include the legacy support solution and projects for Visual Studio 2002, because that can’t be installed on a 64 bit machine.).

This large number of projects and solutions includes every version of Visual Studio from Visual Studio 2017 to Visual Studio 6.

We needed to have a build tool that would allow us to reliably build a project, or solution, or a specific configuration of a project, regardless of version of Visual Studio or programming language.

All this would be done with one simple to use software tool that could be used interactively with a GUI or from the command line. The tool would provide visual feedback so that you could tell from 50 feet if the build was going pear shaped. The tool would also provide notifications so that you could forget about it and go do something else instead.

Visual Studio Project Builder

I’ve seen various solutions to this problem, lots of scripts, batch files, programs interacting. It works, kind of, but it’s all a bit of a mess, held together with string and duct tape in the best “make it work” seat of the pants “we haven’t got enough time” developer fashion.

That isn’t what I wanted. We’d already finished Visual Studio Project Fixer and I was very pleased with the results from that. I wanted the same “one tool” approach. We had the requirements, we knew what we needed to be able to build. We knew we had a decent test case (build our own tools) and we knew what a good tool would look like. As simple as possible.

That’s how Visual Studio Project Builder was born.

The basic capabilities are:

  • Automatically discover solutions and projects.
  • Optimise the build order.
  • Build, rebuild, clean project for any Visual Studio version from 2017 to 6.
  • Build individual project configurations, or variations based on project, solution and configuration.
  • Easily identify warnings and errors.
  • Easily filter warnings and errors.
  • Interactive GUI with real time build progress updating.
  • Can be run from a command line if desired.
  • Works on any Windows OS from Windows 10 through Windows XP.

A simple user interface


When performing a full build, full rebuild or full clean, a progress dialog is displayed, allowing the progress of the build to assessed at a glance, but with extra detail if you want it. You can tell from the colours on this dialog if a build is good, or bad, or has warnings, from 50 feet.


Behind the progress dialog is the main display, showing the status of every project configuration that can be built. Colours indicate status (good, warning, compiler error, linker error). A context menu provides access to options related to that project configuration, project or solution. For example:

  • Build all projects named “stubNonMFC” that have the configuration “Win32|Debug”.
  • Rebuild all projects that have the configuration “Win32|Release”.
  • Rebuild all projects in this solution that have the configuration “Win32|Release”.
  • Clean all projects named “tabserv”.
  • View build logfile.
  • View build command line passed to Visual Studio.

Some of the build options from the context menu cannot be done with Visual Studio, except by manual intervention for each project. When you span this across many solutions and projects this becomes very powerful and an incredible time saver.

Build notifications

Software developers perform a mentally taxing job. The last thing you want to add to their list is “Is the build done yet?”. To remedy this problem we have provided several (optional) notification methods:

  • Email when build is complete.
  • Text message when build is complete. Uses Twilio.
  • Speech message when build is complete.

My favourite is the last one. I can go and do something else, read a book, investigate a bug, work on something else, talk to someone, and when the build is done my computer talks to me: “Build Complete, Success”, or “Build Failure. 3 Errors”.

The email and text message notifications are intended for use when you are out of range of the computer talking to you.

We have delayed implementing carrier pigeon functionality until there is a proven market for it.

Does this compete with existing build solutions?

Does this compete with existing build solutions such as IncrediBuild?

No. Incredibuild speeds up builds of projects and solutions by distributing them on your local network.

Visual Studio Project Builder is all about getting projects built, in the right order, even though many toolsets may be in use. It all happens on the same machine. We’re hoping that Visual Studio Project Builder can work with build accelerators like IncrediBuild to speed things up.

Build your Visual Studio Projects

We’ve been using Visual Studio Project Builder in house for some time. We thought it was about time everyone else got a chance to use it. We’re making this available for free. Learn more about Visual Studio Project Builder.

Fixing Visual Studio project problems

By , March 5, 2018 2:51 pm

The productivity sink

Visual Studio is a very productive development environment. However, you can get Visual Studio into a state (for C++ and C developers, at least) where the compile and link both succeed, but when you go to run the executable Visual Studio annoyingly tells you that the build is out of date and would you like to build it?

This is a very frustrating experience. You go around and around in circles trying to work out what is wrong with the project that is causing this warning message to be displayed.

After some head scratching you’ll Google it and find solutions on numerous websites that tell you to do this, or that, or the other. The advice on some sites is consistent with the advice on other sites, some advice is not consistent. Then you find that some advice is for one version of Visual Studio, but you need to do something differently for a different version of Visual Studio.

It’s a mess. But you work out what you need to do, set about it and after tweaking a registry setting, running a tool to grab the output from OutputDebugString (or writing one if you couldn’t find a tool!), you now know which file is causing Visual Studio to tell you the build is out of date. Great!

Er, not so fast. The problem with this is Visual Studio only tells you about the first file that causes it to need to be rebuilt. Any other files aren’t listed, so you have to make the change then repeat the whole cycle. Slow!

“Crikey, that was a lot of effort, I hope that doesn’t happen again”, you think, or perhaps something a bit less polite. And then you remember you’ve got 10 more projects that behave like this, but you’d been ignoring that for a long time. But now you know how to fix it, but you can’t imagine putting in the effort for those 10 projects.

That was the situation we were in, except that just about every project we had (over 200 projects) had this problem. After tackling just one project I knew we had a choice:

  • Ignore the warnings.
  • Fix the warnings manually. Very slow. Lots of typing. Boring. Morale killer.
  • Find a way to automate the fixing of these problems.

Our engineering needs drove the decision.

Visual Studio Project Fixer

We decided to write a tool to make the hard bits of the above easy and to automatically discover what was wrong with a project file, then allow the user to choose which items to fix and which to leave alone. Plus an automatic mode that just fixes everything for you.

Things that can affect a project file are:

  • Missing files. The file exists on disk, but is not specified in the project.
  • Incorrect files. The file exists on disk, but not in the location specified in the project
  • Nonexistent files. The file doesn’t exist on disk, but is specified in the project.
  • Obsolete files. Files from older versions of Visual Studio.
  • .tlog files. Visual Studio file dependency files.

Some examples…

Missing file. You have a class defined in class.h and implemented in class.cpp. Only class.cpp is listed in the project file.

Incorrect file. A file is listed in the project as ..\svlCommonUI\class.h but is actually located at ..\svlCommon\class.h.

Nonexistent file. A resource file is specified that doesn’t exist. .\images\nonexistent.bmp.

Obsolete file. An old format help file from an early version of Visual Studio, carried over in Visual Studio project conversion.

A simple user interface


The image above shows the user interface after a scan of many projects has been performed. The summary display is shown, which lists an overview of the state of the projects and provides an option to automatically fix all the projects. If you click an individual project, the display changes to provided detailed information about that project.

There are four ways of scanning projects, providing for maximum flexibility in automating fixes or manually choosing each fix to apply.

  • Open a project.
  • Open a solution.
  • Open all projects in a directory (and sub-directories).
  • Open all projects in solutions in a directory (and sub-directories).

Having scanned some projects you can examine the results and choose to fix individual projects, or to fix all the projects that need fixing.


The default settings are to backup all project files before modifying them.

Diagnostic Information

It is possible that even with all the information provided by Visual Studio Project Fixer you may still wish to view the output from Visual Studio. Visual Studio 2015 and 2017 provide an option to show you this information. However for Visual Studio 2010, 2012 and 2013 you can enable diagnostic information to be sent via OutputDebugString(). This means that Visual Studio Project Fixer can intercept this information. All you need to do is enable it (from the Edit menu).

Then every time Visual Studio checks the status of a build, it’s output can be seen on the Visual Studio OutputDebugString tab.


Fix your Visual Studio Projects

We’ve been using Visual Studio Project Fixer in house for some time. We thought it was about time everyone else got a chance to use it. We’re making this available for free. Learn more about Visual Studio Project Fixer.

The Startup Wizard

By , December 20, 2016 11:33 am

We’ve just added a new Startup Wizard to all our C++ tools.

The purpose of the startup wizard is to unify the various different dialogs that would be shown the first time the software ran. These would configure different aspects of the software. Placing them all in one place, a wizard, provides a better first run experience. We’ve also taken this opportunity to configure software updates for non-evaluation users of the software. As a final touch, we’ve included an overview video for the software.

Introduction

The first panel explains what’s going to happen next.

startupwizardintroduction

Symbol Environment Variables

The second panel allows you to configure which environment variables (if any) you wish to use to control the symbol search process for symbols contained in PDB files.

startupwizardenvvars

IDE / Compiler

The third panel allows you to configure which IDE / Compiler / Linker you are using. This is important as it affects how symbol lookup is performed (Visual Studio has various quirks in its history of symbol handling, we have to work around that).

startupwizardidecompiler

Software Updates

The next panel is not shown to people evaluating the software. Only purchasing customers see this panel. The panel allows you to configure your software update information and also where the software updates are downloaded to.

It is important to be able to specify where they are downloaded to because of potential security risks that arise from allowing the TMP directory (c:\users\[username]\AppData\Local\Temp) to be executable. We use the TMP directory as a default, but if you think that’s not a good idea you can specify your own download directory and set permissions for TMP to deny execute privileges.

startupwizardsoftwareupdates

Video Overview

The final panel is a video overview of the software. The purpose of this video is to quickly show many areas of the software to encourage you to explore the capabilities of the software.

startupwizardvideooverview

Speeding up merging with Coverage Validator

By , December 16, 2015 11:43 am

Coverage Validator has an option to automatically merge the coverage results of the current session with a central session. This allows you to get an automatic overview of all code coverage without having to merge the results yourself.

Some people use this but some people prefer to record individual sessions then merge the sessions later. This is effective but the merging stage can be slow as to merge two files you need to start Coverage Validator, load two sessions then merge them then save the result. This is known as pairwise merging. Even with the command line support for this, this is time consuming.

-mergeMultiple

To speed this up we’ve just added the -mergeMultiple command line option.

-mergeMultiple takes one argument, a filename. The file contains the list of session files to merge, one per line.

Example command line:
-mergeMultiple e:\cv_merge_multiple.txt -mergeSessions -saveMergeResult e:\cv_merge_result.cvm -hideUI

Example merge multiple file:
e:\cv_help.cvm
e:\cv_red.cvm
e:\cv_green.cvm
e:\cv_blue.cvm
e:\cv_magenta.cvm
e:\cv_cyan.cvm
e:\this_file_doesnt_exist.cvm

Files that don’t exist are not merged. They do not cause any error conditions. This is deliberate – to provide fault tolerance if an intended merge target doesn’t exist for some reason. The last thing you want is a failed merge.

Performance improvement

We’ve tested this with one of our customers that could benefit from merging multiple files in one go. The performance improvement for merging 84 files (resulting in a 3.66GB merged session file – 64 bit Coverage Validator) is a speed up 8 times (pairwise merge time was 32 minutes, with -mergeMultiple the merge time is now 4 minutes).

How to be more productive

By , December 30, 2014 11:57 am

A few weeks ago @BobWalsh asked on twitter how to be more productive.

I dashed off a simple reply about turning various things off. I thought I’d expand upon this topic.

Productivity isn’t just one thing. It’s many things and they all need to be aligned to allow you to be productive.

Know your topic

Seems obvious, but how many times have to tried to do something that you aren’t that good at and it’s taken forever? And the result was OK, but you know it could have been better. Would this particular task have been better delegated to someone else or even outsourced to a trusted third party?

Willpower

You have limited willpower. Concentrating on a task, or many tasks requires effort. You only have so much energy available for that effort before your energy reserves are depleted and you either need to eat, rest or sleep. Choose what you spend your energy on wisely.

Don’t multi-task

There is this myth that some people can multi-task and some people can’t. In particular this myth is biased in favour of women. However in neurological terms, humans are not wired to multi-task. We can appear to multi-task (just as single core CPUs did) by context switching. Context switching in humans is slow and consumes energy. If your blood sugar is low you will not be good at this. This StackExchange question discusses the penalties associated with context switching.

Remove distractions

Every distraction is a request to context switch to attend to that distraction. And then context switch back to the previous distraction or on to a new distraction. This is why the job of receptionist in a hotel, a hospital or a veterinary surgery is not as simple as it seems. Each micro task isn’t hard. But it’s the sheer volume of them and often multiple balls in the air at the same time – this takes energy.

In terms of your working life, if you are tech then the chances are you have these things around you:

  • Twitter
  • Facebook
  • LinkedIn
  • Smart phone
  • Text messaging
  • Wired phone
  • Email
  • Other productivity tool
  • Work colleagues
  • Open plan work environment
  • Office politics
  • (and possibly minority/sexist micro-aggressions)

But you’re actually trying to workout how to write some software for your company to meet the company product release deadline. Or you’re trying to debug someone else’s software and you need to get your head into their software space to understand what’s happening, or it’s a code review, or you’re examining the DNA of this interesting cancer, or something equally taxing. In short what you really want to be putting your energy is this interesting task but you are constantly pulled away from it by all these other sources of distraction.

Twitter

Turn off your twitter client. You don’t need to be on twitter all day, every day. You can always check in when you have a break or at the start/end of the day.

Facebook

Log out of facebook. Same as twitter, but it’s even less realtime so you definitely don’t need this open in your browser all day.

LinkedIn

Log out of LinkedIn. Same as twitter and facebook.

Smart phone

Turn it off. Completely off. No notification pings, no vibrates, no calls, nothing. So many apps on your phone to distract you and pull you away from work.

Text Messaging

Seriously. I know people under 25 seem to live in their text messaging world but I have news for you. If you turn off your phone the world will keep spinning. And your friends will still be there when it comes to lunch time and you can check up on what hasn’t happening in the (gasp!) last 4 hours.

Wired Phone

Unplug it. Turn off the ringer. Turn down the volume on the answerphone.

Email

You don’t need your email client open all the time. Check it once per hour, or once every two hours. For an extreme take, do it like Noah Kagan. Twice a day – once at the start of the day and once at the end of the day. OK, so some conversations won’t go as fast but everything will get attended to. And you might even focus on those emails a bit more because you’ve dedicated time to them rather than trying to time slice them with everything else in the day.

Trello / Other productivity tool

There are loads of planning/scheduling tools out there. Trello has taken off in a big way. Great. I have nothing against them. But you don’t need to fixate on it all day. Close the browser page. You can check the status of something when you actually need the information, not just because something has moved and you need to know, RIGHT NOW, what that was.

Work colleagues

Not a lot you can do about these. They need your help. You need theirs. If you can’t interact nothing will get done. But you can give strong hints as to when it’s OK to talk to you and when it’s not. Some folks put a red flag on their desk (or something equally unusual) to signify “I’m busy, don’t bother me”. Try it.

Open plan work environment

Yes, these are great. And they can be awful. Good for fostering openness and communication. Bad for controlling noise. For some tasks you may be better trying to get an office for an afternoon or take the work home.

Office politics

Er, not sure how to turn this one off.

Go for a walk

I’m serious. If you can’t get your head around a problem. Go for a walk. Preferably in the countryside. I live in a small country village. An average house on a housing estate. But I’m surrounded by farmland and the largest wetland in Europe (The Ouse Washes). Lots of the engineering problems at Software Verification have been solved while walking on this farmland enjoying the scenery, letting my brain wander and then out of nowhere a solution or partial solution appears. Back to the office and usually have a working demo by the end of the day.

Alternatively, a long soak in a hot bath (optional bottle of wine) often does the same job. Don’t try this one at work!

Alternatively, learn to meditate.

If it’s not obvious the key thing is getting your mind to relax and wander. Turn off the concious problem solving part of your brain and wait.

Caffeine

Get Caffeine out of your life. I really enjoy Caffeine (when provided by Tea, but not by Coffee) but I’m glad I stopped consuming Caffeine. It’s a myth that it makes you better at your job. I should probably also do the same with alcohol, but I have considerably reduced my consumption of that as well.

List

Make a list of all the things you need to do today. Identify the order of importance and how big/small a task it is. If you have lots of short tasks that are easy to do, do them. This reduces the list size and gives you a sense of progress, which is a good emotional boost. Then tackle the important and big tasks first. Cross each task off the list as you complete them. It’s trivial stuff to do, but this is emotional recognition of progress. Surprising what such simple tricks can do to your inner sense of “getting stuff done”.

If you find that you are not comfortable with the list on any given day that’s a good indicator that the tasks on the list – you haven’t fully decided how each task will be completed. So work on understanding each task a bit better. This may mean breaking the task into subtasks, or it may mean you just need to think about the task a bit more.

Summary

The days when I feel the most distracted, the least at ease, can’t decide what to work on it’s when there is nothing on the list that interests me and I have all these distractions turned on. The solution is to remove the distractions and then work on the contents of the list.

I’m not saying twitter, facebook et al are bad. I’m saying that they need to be used with care. So turn them off when you are working and turn them on when you need to plug in.

Panorama Theme by Themocracy