The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Archive for the ‘Visual Studio 2003’ Category

.NET Framework 1.1 and Visual Studio .NET 2003 support ended 20131008 (via: Microsoft Support Lifecycle)

Posted by jpluimers on 2013/11/27

WorPress did it again to me:

2013/10/08; Missed schedule

Anyway:

If you still have a coded base in the .NET Framework 1.1 / Visual Studio 2003, then you should note that after 20131008, the extended support has ended.

Though the introduction of both feels like yesterday to lots of us, they have been supported for more than 10 years. An era has ended. Time to move on to newer versions has passed long ago.

The next important date is about 2.5 years from now: 2016-04-12, when the support for the .NET Framework 2.0 and Visual Studio 2005 ends.

From the Microsoft Support Lifecycle: .NET Framework 1.1 and Microsoft Support Lifecycle: Visual Studio .NET 2003 pages (I formatted the dates into YYYY-MM-DD): Read the rest of this entry »

Posted in .NET, .NET 1.x, C#, C# 1.0, Development, Missed Schedule, SocialMedia, Software Development, Visual Studio 2003, Visual Studio and tools, WordPress | Leave a Comment »

Dot Net Tips & Tricks, C# (C Sharp)Tips & Tricks: Visual Studio Immediate Window

Posted by jpluimers on 2013/03/06

Great post on what you can do with the Immediate Window: Dot Net Tips & Tricks , C# (C Sharp)Tips & Tricks: Visual Studio Immediate Window.

It is far more than you’d expect on first sight.

The really good thing: this Immediate Window gem has been there for over a decade (:

–jeroen

Posted in Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Integrating Beyond Compare into Visual Studio for use with Team Foundation System

Posted by jpluimers on 2013/02/05

Clarification of the steps from via Support Beyond Compare to use Beyond Compare 3 or 2 from Visual Studio and with Team Foundation System.

First run this little batch file to show you the exact location of BComp.exe:

@echo off
  call :show "%ProgramFiles%\Beyond Compare 3\BComp.exe"
  call :show "%ProgramFiles(x86)%\Beyond Compare 3\BComp.exe"
  call :show "%ProgramFiles%\Beyond Compare 2\BComp.exe"
  call :show "%ProgramFiles(x86)%\Beyond Compare 2\BComp.exe"
  goto :eof
:show
  if not exist %1 goto :eof
  echo Beyond Compare is here:
  echo %~1

(I know that this will not find a Portable Beyond Compare installation).

Note that BComp.exe (for GUI use) and BComp.com (for console use) are bootstrappers for BCompare.exe. Both will wait when ran from a GUI or console for the comparison to finish. Starting BCompare.exe will not wait. See BComp.exe vs BComp.com – Scooter Forums for more information on this.

Everywhere you see path to BComp.exe below, enter the path that the above batch file tells you.

The first two pictures on the right show common steps for all three integrations. The images below are the specific ones for each integration. You can click on each image to view a larger version.

The steps work with the full version of Visual Studio and the Team Explorer edition of Visual Studio.

You can find different arguments for other tools on this excellent diff/merge configuration in Team Foundation – common Command and Argument values post by James Manning.

Adding diff/compare support to Visual Studio

  1. In Visual Studio Choose Options from the Tools menu.
  2. Expand Source Control in the treeview.
  3. Click Visual Studio Team Foundation Server in the treeview.
  4. Click the Configure User Tools button.
  5. Click the Add button.
  6. Enter “.*” in the Extension edit.
  7. Choose Compare in the Operation combobox.
  8. Enter the path to BComp.exe in the Command edit.
  9. In the Arguments edit, use:
    %1 %2 /title1=%6 /title2=%7
  10. Then press OK, then OK, then OK

Adding 3-way Merge to Visual Studio

You need Beyond Compare version 3 Professional for this.
(note: only the steps marked with * are different from above)

  1. In Visual Studio Choose Options from the Tools menu.
  2. Expand Source Control in the treeview.
  3. Click Visual Studio Team Foundation Server in the treeview.
  4. Click the Configure User Tools button.
  5. Click the Add button.
  6. Enter “.*” in the Extension edit.
  7. * Choose Merge in the Operation combobox.
  8. Enter the path to BComp.exe in the Command edit.
  9. * In the Arguments edit, use:
    %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9
  10. Then press OK, then OK, then OK

Adding 2-way Merge to Visual Studio

This is for Beyond Compare version 2, and Beyond Compare version 3 Standard.
(note: only the step marked with * is different from above)

  1. In Visual Studio Choose Options from the Tools menu.
  2. Expand Source Control in the treeview.
  3. Click Visual Studio Team Foundation Server in the treeview.
  4. Click the Configure User Tools button.
  5. Click the Add button.
  6. Enter “.*” in the Extension edit.
  7. Choose Merge in the Operation combobox.
  8. Enter the path to BComp.exe in the Command edit.
  9. * In the Arguments edit, use:
    %1 %2 /savetarget=%4 /title1=%6 /title2=%7
  10. Then press OK, then OK, then OK

To summarize, the differences

Functionality
entry in
Operation combobox
content of
Arguments edit
Beyond Compare
version/edition
 diff/merge Compare %1 %2 /title1=%6 /title2=%7 any version/edition
3-ware compare Merge %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9 3/Professional
2-way compare Merge %1 %2 /savetarget=%4 /title1=%6 /title2=%7 2 or 3/Standard

Hope this helps a few people.

–jeroen

via:

Posted in .NET, Beyond Compare, Development, Power User, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Converting Visual Studio 2003 WinForms to Visual Studio 2005/2008/2010/2012 partial classes (via: Duncan Smart’s Weblog)

Posted by jpluimers on 2013/01/10

In the .NET 1.x past, the WinForms designers in Visual Studio .NET and Visual Studio 2003 would put the C# or VB.NET code containing the form code as the InitializeComponent method of the top most class monolithic C# and VB.NET files that also contain the user code (for events and such).

As of Visual Studio 2005 (actually: Whidbey and higher), this code is based on partial classes. For each form (actually designable entity, but lets limit this to WinForms forms) you get a MyForm.cs and MyForm.Designer.cs

As a side note, with a bit of effort, you can generate the Windows Form Designer generated code yourself as this answer shows. This is for instance convenient when you have form definitions in a different technology and want to convert it to WinForms, WPF or another form of designer based .NET code.

I long time ago I wrote a short manual for co-workers on converting the monolithic files (for people interested, it is below).

Since then I found a couple of very interesting links: Read the rest of this entry »

Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, WinForms | 1 Comment »

VB.NET history: VBPowerPack download (formerly from GotDotNet) via: VB Helper: Tip: GotDotNet Visual Basic Power Pack Going Away

Posted by jpluimers on 2012/11/28

I was involved in porting a Visual Studio 2003 VB.NET solution to the latest Visual Studio.

One of the things present was a binary (don’t ask) version of the VBPowerPack, which used to be available on GotDotNet.

Though you can link against .NET 1.1 assemblies from .NET 2.0 and up, I’d rather have source.

That allows me to fix things whenever something comes up (it probably does, as VBPowerPack was pre-Aero, so the controls in it might need some adjustments).

GotDotNet was hated by many people, and finally closed in 2007 by Microsoft in favour of CodePlex (don’t you just love the cloud?).

Luckily, people do archive stuff, so VB Helper has VBPowerPack.

The download is a simple MSI installer, that you can extract using something like this:

msiexec /a PathToMSIFile /qb TARGETDIR=DirectoryToExtractTo

–jeroen

via:

Posted in .NET, Development, Software Development, VB.NET, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | 1 Comment »

“tfpt treeclean /exclude:*.suo,*.user” is what I use most (and recommend this thread: Does any tool exist to help Sync a directory with TFS? – Stack Overflow)

Posted by jpluimers on 2012/09/20

This post describes the TFS workspace cleanup features Treeclean and Scorch.

Both are not in the Visual Studio UI nor TFS tool, but are available form the ftpt command from the optional Team Foundation Power Tools package.

The main reason you need these two features is that TFS does not always clean up after it self when you perform get latest. For instance renamed directories, as well as bin and obj directories are not automatically removed.

The tfpt command I most often use this this one:

tfpt treeclean /exclude:*.suo,*.user

This deletes files from your local TFS workspace directory tree that are not in the source control system, but skips the *.suo and *.user files.

Tfpt also allows you to scorch files from your TFS.

So my second most used tfpt command is scorch in either of the two below forms:

tfpt scorch /recursive /diff
tfpt scorch /recursive /diff /exclude:*.suo,*.user

The first form is for the automatic build environment, the second for my normal development workspace.

Below is the explanation of treeclean and scorch.

First some other great commands from this StackOverflow answer by Martin Woodward:

Not quite, however you might want to download the TFS Power Tools and check out the command line utility tfpt.exe.

The “tfpt online” and “tfpt treeclean” might be most useful to you when working outside of an integrated TFS client. tfpt online will look for files in your local directory that are not under version control, treeclean will show you files in your local directory that are not under version control so that you can remove then if they are not required.

Scorch versus Treeclean

Scorch does more than Treeclean.

I use Treeclean for 90% of my normal workspace work, Scorch (with exclude) for about 10% of the time in my regular workspace.
For my CCnet build integration workspace, I only use Scorch (without exclude).

Treeclean just cleans the tree of stuff that is not in TFS:

B:\MasterWorkingDir>tfpt treeclean /?
tfpt treeclean - Delete files and folders not under version control

Usage: tfpt treeclean [/exclude:filespec1,filespec2,...] [filespec...]
[/recursive] [/batchsize:num] [/noprompt [/preview]]

Scorch does more work: at the end, both source control and the local disk situation are identical.

B:\MasterWorkingDir>tfpt scorch /?
tfpt scorch - Ensure source control and the local disk are identical

Your local disk will be scanned for:
 (1) items that are not in source control
 (2) items which are different on disk from the workspace version
 (3) items which are in the workspace but are missing on disk
Items not in source control will be deleted from disk, just as with the
 tfpt treeclean command. Items determined to be different on disk from the
 workspace version will be redownloaded from the server. Items missing on
 disk will also be redownloaded. Items with pending changes are exempted.

By default, items deleted from your local disk (#3 above) will not be
scanned for, and local items are determined to be identical/different from
the workspace version *solely by examining the read-only bit on the file*.

To redownload items deleted from your local disk (#3 above), supply the
/deletes option. To detect items which are different from the workspace
version but still have their read-only bit set (+R), supply the /diff option.
When using either or both of these options, tfpt scorch runs more slowly.

Usage: tfpt scorch [/exclude:filespec1,filespec2,...] [filespec...]
[/recursive] [/batchsize:num] [/noprompt [/preview]]
[/deletes] [/diff]

The commandline options are also different.

Scorch has these extra when compared to Treeclean:

/batchsize:num Set the batch size for server calls (default 500)
/deletes Detect and replace items missing from the local disk
/diff Use MD5 hashes to compare items with source control

Treeclean can have these options:

/noprompt Operate in command-line mode only
/exclude:filespec[,..] Files and directories matching a filespec in this list
are excluded from processing
/preview Do not make changes; only list the potential actions
/recursive Switch from one level of recursion to full recursion
/batchsize:num Set the batch size for server calls (default 500)
filespec... Only files and directories matching these filespecs
are processed

Scorch can have these options:

/noprompt Operate in command-line mode only
/exclude:filespec[,..] Files and directories matching a filespec in this list
are excluded from processing
/preview Do not make changes; only list the potential actions
/recursive Switch from one level of recursion to full recursion
/batchsize:num Set the batch size for server calls (default 500)
filespec... Only files and directories matching these filespecs
are processed

–jeroen

via:

Posted in CodePlex, Development, Software Development, Source Code Management, TFS (Team Foundation System), Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | 4 Comments »

Creating a blank Visual Studio solution without a directory, and sln Format Version numbers

Posted by jpluimers on 2012/09/06

A while ago, I blew quite a few Visual Studio Solution and Project builds because I was experimenting in a suite of solutions with the Configuration Manager adding other Solution Configurations than Release and Debug, and mixing x86/AnyCPU platforms to facilitate Debug & Continue.

Lesson learned: don’t do that!

Keep it simple:

  1. Keep your Solution Configurations at Release and Debug,
  2. Perform conditional defines in your automated build server,
  3. Limit the mixing your platforms to a minimum.

We noted the anomalies a little late in the process (in retrospect, when taking over the solution suite, we should have started with setting up and Build Automation right at the beginning, then fix all the solutions that came from Visual Source Shredder, but alas: you are never too old to learn from your mistakes).

The anomalies were spurious (and hard to reproduce) build failures at developer workstations, wrong builds of assemblies ending up on the final build directories and more. And best of all: Visual Studio not failing, warning or hinting upon most issues.

Fixing projects and solutions from wrong Solution Configurations

The history in the version control system was not helpful enough to assist in fixing it, so the fix was this:

  1. Manually edit the .csproj files, and remove the PropertyGroup elements other than “Debug|AnyCPU” and “Release”AnyCPU”.
    This is easy to do inside Visual Studio and with automatic checkout from TFS of the project files:

    1. In the Solution Explorer, select all the projects
    2. Right click on a project
    3. Choose “Unload Project”
      (because you selected all the projects, it is the second menu item from the bottom, and way easier to find when you do this per project)
    4. For each project
      1. Right click the project
      2. Choose “Edit ….”
      3. Remove the PropertyGroup elemts you don’t need
      4. Save and close the file
      5. Right click the project
      6. Choose “Reload Project”
  2. Fix the solution files

The last step is a lot more complex, because of a couple of reasons:

My workaround was as follows:

  1. Start with an empty solution in the same directory as the original solution
  2. Add all the Solution Folders, Solution Items, and projects to it that  were in the original solution
    (having two copies of Visual Studio next to each other on a dual monitor setup is of great help)
  3. Compare the .sln files to each other
  4. Check out the original .sln file
  5. Merge any changes into the original .sln file
  6. Build it
  7. Check in
  8. Run a build on the CruiseControl.net automated build server
  9. Fix build errors
  10. Delete the temporary local .sln file

Creating an empty solution in a directory

Finally, I get to the title of this blog entry: Visual Studio will always generate a directory when creating a Blank Solution, and does not support creating an Empty Solution in a directory.

There are many posts describing how to workaround this, but the actual downloads are usually gone because of link rot (Jakob Nielsen’s alert from 1998 still is totally right about it). Thanks to they webarchive.org WayBackMachine though for keeping some of them alive.

So I went with Peter Provost’s solution, and amended it from Visual Studio 2005 to all Visual Studio versions that support .NET that I have used or still use: 2002, 2003, 2005, 2008, 2010 and 2012 a.k.a. VS11.

All files are in Change set 89386 on BeSharp.CodePlex.com.

His solution uses the ShellNew command for .sln file extensions that is stored in the registry:

  1. Create an empty solution file for the Visual Studio version you are using
  2. Copy that as a template file to %Windir%\ShellNew
    (you need to be administrator for that)
  3. Import a small .reg file binding that template file to the ShellNew command for .sln files

ShellNew is versatile, so you can also embed the fresh solution file into the .reg file, see this ShellNew article for a few nice examples.

Note that generating a new ShellNew verb for .sln is something other than loading a .sln (loading a .sln is done through VisualStudioLauncher).

Back to the .sln file: this one is different for any version of Visual Studio. Historically, the basic format is the same though (and I think this – in combination with VisualStudioLauncher – is the main reason it is not XML).

An empty solution file looks like this (note the empty line at the beginning), as described in Hack the Project and Solution Files:


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 11
Global
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

The accompanying .reg file like this:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.sln\ShellNew]
"FileName"="Visual Studio Solution - VS11.sln"

When you look at the Format Version inside the .sln version, you see that it (12) is one bigger than the internal Visual Studio Version (11).

That is because Microsoft stepped up the internal version from Visual Studio .NET (2002) and Visual Studio 2003 from 7.0 to 7.1, but the solution file format version from 7.00 to 8.00 as the table below shows.

Note that the .NET 1.x versions of Visual Studio (2002 for .NET 1.0, 2003 for .NET 1.1) don’t have the GlobalSection/HideSolutionNode/EndGlobalSection part and the # Visual Studio xx line.

With a little bit of querying, I got at this table:

Visual Studio version Internal version Solution file format version
Visual Studio .NET (2002) 7.0 Microsoft Visual Studio Solution File, Format Version 7.00
Visual Studio 2003 7.1 Microsoft Visual Studio Solution File, Format Version 8.00
Visual Studio 2005 8.0 Microsoft Visual Studio Solution File, Format Version 9.00
Visual Studio 2008 9.0 Microsoft Visual Studio Solution File, Format Version 10.00
Visual Studio 2010 10.0 Microsoft Visual Studio Solution File, Format Version 11.00
Visual Studio 2012 (a.k.a. VS11) 11.0 Microsoft Visual Studio Solution File, Format Version 12.00

All files to get you going are in Change set 89386 on BeSharp.CodePlex.com.

It was a bit hard to get all those version numbers, so here are the sources I used:

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, Internet, link rot, Power User, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, WWW - the World Wide Web of information | Leave a Comment »

registry editing: How do you clear your MRU list in Visual Studio? – Stack Overflow

Posted by jpluimers on 2012/08/18

A question like How do you clear your MRU list in Visual Studio? is why I still like Stack Overflow.

The answers explain how to solve this in a version neutral way, including other MRU lists, and as a bonus point you to handy Visual Studio tools.

–jeroen

via: registry – How do you clear your MRU list in Visual Studio? – Stack Overflow.

Posted in Development, Software Development, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools | Leave a Comment »

Great session on how to prevent SQL Injection Myths and Fallacies

Posted by jpluimers on 2012/08/15

A few weeks ago, Bill Karwin did a must watch webinar on the prevention SQL Injection titled  “SQL Injection Myths and Fallacies“.

Bill Karwin (twitter, new blog, old blog, Amazon) is famous for much work in the SQL database community, including InterBase/Firebird, mySQL, Oracle and many more.

He also:

Anyway, his webinar is awesome. Be sure to get the slides, watch the replay, and read the questions follow up.

Watching it you’ll get a better understanding of defending against SQL injection.

A few very valuable points he made: Read the rest of this entry »

Posted in .NET, .NET 3.5, .NET 4.5, .NET ORM, ASP.NET, Batch-Files, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, C++, Cloud Development, COBOL, CommandLine, Database Development, Delphi, Delphi for PHP, Delphi x64, Delphi XE2, Development, EF Entity Framework, F#, Firebird, FireMonkey, History, InterBase, iSeries, Java, JavaScript/ECMAScript, Jet OLE DB, LINQ, LLBLGen, MEF, Microsoft Surface, Mobile Development, PHP, PowerShell, Prism, Scripting, SharePoint, SilverLight, Software Development, SQL, SQL Server, SQL Server 2000, SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 7, VB.NET, VBS, Visual Studio 11, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, Web Development, Windows Azure, WinForms, WPF, XAML, xCode/Mac/iPad/iPhone/iOS/cocoa | 1 Comment »

.NET/C# – WinForms splash screen research material

Posted by jpluimers on 2012/06/21

I’m in the midst of converting a suite of WinForms C# projects from a range of .NET versions (1.x till 3.x) to 4 totalling some million lines of code.

One of the problems is that some people hacked together some splash screen stuff using multi-threading, doing all sorts of things that was forbidden in .NET 1 (and broke in .NET 2+).

On my research list for getting this to work:

  1. Mahin Gupta | Winforms splash screen – Great work by Tom. which is an update of
  2. A Pretty Good Splash Screen in C# – CodeProject.

–jeroen

Posted in .NET, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, Development, Software Development, Visual Studio 2002, Visual Studio 2003, Visual Studio 2005, Visual Studio 2008, Visual Studio 2010, Visual Studio and tools, WinForms | Leave a Comment »