Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Weird error when I create a new VB project

I'm running a trial copy of the .net development environment and wanted to try some simple desktop programs. Unfortunately my new PC (win XP) had an intermittent hardware error and kept locking up (nothing to do with .net since it happened at other times). It's been fixed now (it was back at the makers for about 6 weeks), and I reinstalled the trial copy.

I can create a new project in C++ with no problems. But if I create a new VB project I get: "an error occurred while loading the document. Fix the error and then try loading the document again. The error message follows: Method not found: System.Object[] System.Runtime.InteropServices.Marshal.GetObjectsForNativeVariants(IntPtr,Int32)." This is when it tries to display the VB form editor. I don't know which files are missing or what it wants.

The version in help-about is Microsoft Developer Environment 7.0, ver 7.0.9254. 

The problem may be my .net runtimes are mixed up. I know XP2 comes with runtimes, and the PC makers downloaded lots of service paks for XP when fixing my PC. Also I think I originally installed the trial pack and I may have refreshed it from the beta 2.

Do I basically uninstall anything .net related then re-install just the trial pack? Or do I need to reformat, reinstall XP and start again? Has anyone else found these sorts of errors? I'm reluctant to shell out large sums for the professional package if it causes this much grief just with a 'hello world' vb program. Surely each version can figure out what files it needs and make sure it's installed properly.

All ideas/comments welcome.

Bill Rayer
Monday, April 28, 2003

It gets better: after I logged off yesterday I went back to my .net dev PC and the IDE had a big red cross with a message box "Generic GDI error", and the push-buttons were OK and LAME! I don't think MB_LAME is a documented MessageBox() value.

Are these the sorts of problems that .net programmers are going to have when we install the runtime on customers machines? Or will .net projects be provided with large amounts of expensive consultancy :)

Bill Rayer
Tuesday, April 29, 2003

The "LAME" buttons are a feature of the VS.NET betas. Pushing it sends an error report to MS.

It sounds like you've got leftover beta bits. You might want to consider removing VS.NET and reinstalling.

This is independent of the framework itself. There have been no service packs to VS.NET - only to the underlying framework.

Chris Tavares
Tuesday, April 29, 2003

I think you're right - I'll remove everything and start again. I also discovered I had two frameworks so I'll get rid of both these.

Are compiled assemblies going to be dependent on particular versions of the framework? I guess if this is true, then installing a compiled assembly on a customer machine should also include the correct framework.

3 years ago I worked on an installation program for a large app written in Java. Because different parts of the app used different versions of Java, we had to temporarily 'hide' the different Java runtimes during the installation by renaming them. It is my (naive?) hope that .net should avoid this kind of garbage.

Bill Rayer
Wednesday, April 30, 2003

If you compile with VS.NET 2002, your assembly will require the V1.0 framework.

If you compile with VS.NET 2003, your assembly can be configured to run with either V1.1 or V1.0, but by default it will require V1.1.

Both frameworks can be installed on the same machine, and run side-by-side transparently.

Look here:

http://www.3leaf.com/default/articles/ea/SBS.aspx

for more information and better writing than I can do.

Chris Tavares
Wednesday, April 30, 2003

Thanks for the link - I would never have found that! Interestingly both my versions are 1.0 (1.0.2914 and 1.0.3705). This comment from the 3leaf.com site sums it up:

"The Framework V1.0.3705: I am the Framework.  I run managed code.  I am without flaw.

The Framework V1.1.4322 I am the Framework.  I run managed code.  I am without flaw."

It seems the same kind of subtle incompatibilities between runtimes that caused problems for Java will cause problems for .net. Anyway I'll post here when I've removed and reinstalled the framework and VS.

Bill Rayer
Wednesday, April 30, 2003

1.0.2914 was from a Release Candidate if I'm not mistaken.

GiorgioG
Wednesday, April 30, 2003

And I can't remove it either. If I use Add/Remove programs I get the helpful message ".NET framework setup. Setup cannot read/write to System registry". And if I try and install .NET 2002 it says I have to remove the old framework first.

So do I delete the framework directories? Or do I reinstall XP? Or go back to MS-DOS :)

Bill Rayer
Thursday, May 01, 2003

I think I've found the answer:

- I have installed the beta, therefore I must be punished.

- My punishment is the beta framework can never be removed, except by manually editing the registry.

- Furthermore the beta framework will not permit any more up to date framework to be installed.

- As repentance, I must reinstall Windows XP, possibly having to buy a new copy.

Thanks to http://www.maclean-nj.com/compute/vsbetas.htm for outlining this info.

Bill Rayer
Thursday, May 01, 2003

The uninstallers for the betas never really worked right.

That's why the beta license says effectively:

"This is a beta. This means this software doesn't work. It may reformat your hard drive. It may reset your home page to goatse.cx. It may steal your credit card number and order 3000 sets of leiderhosen. This is a beta.

You have been warned."

;-)

Chris Tavares
Thursday, May 01, 2003

Ja, das is rechtig! Any offers for 2997 pairs of lederhosen incorporating the Microsoft logo? Oh, and a PC with XP and a framework which is not installed and can't be removed. Sort-of like a quantum particle, but harder to understand :)

Bill Rayer
Friday, May 02, 2003

*  Recent Topics

*  Fog Creek Home