In an earlier post I mentioned my disappointment with Microsoft for not including wincv.exe in the .NET Framework 2.0 SDK. Like many developers I have found this tool to be very handy and I use it a lot. But all is not lost. WinCV.exe can be used with .NET 2.0.

WinCV.exe has a config file called WinCV.exe.config identifying the assemblies loaded and exposed by the tool. I modified the config file to include the .NET 2.0 assemblies. Low and behold this worked. I can now use WinCV.exe to examine class definitions for 2.0 classes.

I recommend copying the WinCV.exe and WinCV.exe.config to a clean directory if you have .NET 1.1 and 2.0 installed on the same machine. This way you can use one instance of WinCV.exe for .NET 1.1 and the other for 2.0. You can declare the 2.0 assemblies in the same config file as the 1.1 assembly but this can lead to confusion when looking at the class definitions in WinCV.exe. I like to eliminate confusion so I copied WinCV.exe and its config file to a different directory, which I use to browse 2.0 classes. I use the instance at the default location to browse 1.1 classes.

I have posted the WinCV.exe.config file containing the 2.0 assembly declarations here. Note I had to rename the file stored on the web server to WinCV.exe.config.xml so ASP.NET would not block you from downloading it. You will need to remove the .xml from the file extension or copy|paste the XML if you are viewing it in the browser window.

Lastly, for those of you wondering where you can find WinCV.exe, look in your Visual Studio 2003 install directory. The default location is:

C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin

Kudos to the Microsoft developer who had the smarts to use a config file for WinCV.exe.

Update: The WinCV.exe.config file posted above has the <startup> section needed to force WinCV.exe to run under .NET 2.0 when multiple versions of the .NET Framework are present on the same machine. Thanks to Don Jayamanne for recommending the the section setting.

posted by Kirby | 22-Nov-2005 4:25 PM | comments (20)


I followed your steps to copy wincv.exe and wincv.exe.config to a new directory and copy your wincv.exe.config. The result is still showing .Net 1.1. Do you know what is wrong?

Thanks

posted by jamiec | January 27 01:11 AM


I followed your steps to copy wincv.exe and wincv.exe.config to a new directory and copy your wincv.exe.config. The result is still showing .Net 1.1. Do you know what is wrong?

Thanks

posted by jamiec | January 27 01:11 AM


Did you rename the config file you downloaded? The file name on the web server has the extension .xml. The .xml needs to be removed.

Or you can view the file through the web browser and replace the contains in your local wincv.exe.config file.

Also, make sure you are running the wincv.exe that is in the new directory.

That's all I can think of for the moment.

posted by Kirby Turner | January 27 08:11 AM


WinCV Still pointing to .NET 1.1

posted by Raj | February 1 07:01 AM


Can't say I know why it is still pointing to .NET 1.1. I have a virutal machine with only .NET 2.0 and WinCV is able to load the 2.0 assemblies without a problem.

I'll play around with it more to see if I can figure out what is happening.

posted by Kirby Turner | February 1 12:55 PM


Thank you

posted by | February 2 09:58 AM


I've tried this solution on my machine as well and it isn't working. I have all three versions of the Framework and I can see classes from 1.0 and 1.1 in WinCV but not 2.0. Maybe the problem only occurs when more than one version of the Framework is available at the same time? I'm testing it on my machine by trying to find TableLayoutPanel in WinCV.

posted by John M | February 23 11:43 AM


It definitely sounds like it has something to do with having more than one version of the .NET Framework installed. I have a machine which only has .NET 2.0 installed and WinCV works fine as described above. I have yet to try it with multiple .NET versions installed.

posted by Kirby Turner | February 25 07:57 AM


>> It definitely sounds like it has something to do with having more than one version of the .NET Framework installed.

That's true. Here is what I've done to make WinVC use version 2.0 :
The C:\WINDOWS\Microsoft.NET\Framework directory should contain both versions of binaries. Just move the 1.1 (or 1.0) directory to another place.

posted by DL | October 2 03:47 AM


Hello DL,

Can you please explain your steps in details ?

posted by Ajay Kumar | October 19 06:31 AM


Include the following into the "Startup" section of the configuration file (forcing WinCv to use the .NET 2.0 framework when loading)

requiredRuntime version="v2.0.50727" safemode="true"

posted by Don Jayamanne | January 2 10:39 PM


I have wincv.exe file
I was currently used VS.NET 2.0

posted by Prashant | January 15 11:46 PM


i have both versions of .net.please tell me how can i use wincv.exe in 2.0 version and please tell me the whole procedure of using wincv in 2.0

posted by Puneet Rajpal | January 19 04:46 AM


Thanks Don Jayamanne,

That worked for me just fine.

I have all three versions of .net installed and per Don's advice made the following section in my winCV.exe.config file:

<startup>
<requiredRuntime version="v2.0.50727" safemode="true"/>
</startup>


Works like a charm.

Paul

posted by Paul | February 6 11:44 AM


Thanks
It worked perfectly for me

posted by Kevin | February 9 05:29 AM


Can you please post your entire working config file?

I'd prefer not to have to guess where the startup element needs to go in the config file.

Thanks!

posted by John Spadafora | April 10 01:13 PM


The config file has been updated to include the start section forcing WinCV.exe to run under Version 2.0 of the .NET Framework.

posted by Kirby Turner | April 10 01:39 PM


Thanks for the update but...

Using the updated config file, WinCV.exe throws exceptions when I try to use it.

Lutz Roeder's .NET Reflector works significantly better with .NET 2.0.

http://www.aisto.com/roeder/dotnet/

posted by John Spadafora | April 11 10:35 AM


To the best of my knowledge Microsoft has not released an updated version of WinCV.exe for .NET 2.0 so it doesn't surprise me you are having a better experience with Reflector (a great tool by the way). The configuration file posted here works for me, but I have to say I rarely use WinCV.exe these days.

posted by Kirby Turner | April 12 05:13 AM


Hi Kirby Turner

Thanks a lot.. It works for me.. :)

posted by SHAURYA MALHOTRA | November 10 12:53 AM

Add Your Comment

Comment:
(No HTML)

Name:
E-mail/Web site:
Your e-mail/web site will not be published on this site. It is optional and will only be used by me should I need to contact you directly.
 
By checking this option, this site will remember your name and e-mail/web site on future visits. Uncheck this option to have the site not remember who you are on future visits.
 
Enter the code shown above:
Copyright © 1999-2008 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.