Archived

This topic is now archived and is closed to further replies.

penetrator

.NET trouble with Visual Basic

Recommended Posts

I have a project which build and run correctly on my pc. However, when i run the .exe on another pc, i get ''set registry key HKLM\Software\Microsoft\.NETFramework\InstallRoot to point to the .NET Framework install location'' Is there a way to disable this Framework or a workaround to this error ? Thanks
www.web-discovery.net

Share this post


Link to post
Share on other sites
You can''t do that.

VB.NET compiles programs that run on the .NET framework. VB.NET is incompatible with VB6.

If the .NET framework is not installed, the program won''t run. Simple as that.

Rewrite in VB6 or Install .NET framework, those are your options.

Share this post


Link to post
Share on other sites
Wait a second here.

If I write a program in .NET just as I would in VB6 and try to distribute the Release executable (if such a profile concept still exists in .NET) to a few friends or whomever, then it won''t run unless they have the .NET framework installed? Is there something I''m missing? That sounds like shit, but not unlike Microsoft.

Share this post


Link to post
Share on other sites
It''s not shit. You still need the VB6 runtime to run VB6 programs, even in release mode. The VB6 runtime is just a bit smaller than the .NET one.

VB.NET is a .NET language. So is C#. So is managed C++. That means to run programs written any of these languages you need the .NET runtime. (The exception in unmanaged C++. C++ is the only ".NET" language which can run in native mode and doesn''t require the runtime to run)

It''s only a 20MB or so download, and it''ll be included in the next Windows XP service pack anyway, so it''s really not that big a deal.

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
Simple solution then: don''t use VB.NET. It''s not like Microsoft tried to hide the fact that you also need the .NET runtime to use .NET languages. Heck, that''s why it''s called the .NET "runtime".

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
Its not a policy - its a necessity. I suggest you read this rant by Sam Gentile called "It's the runtime, stupid!"[1]:

This is not Windows. This is not COM. To program in .NET is a whole new ballgame folks. Throw out everything you knew in MFC, COM, etc. If you want to program in .NET, you must learn and understand how .NET works. That means understanding the basics of the Common Language Runtime, Garbage Collection, Finalization, the Dispose Pattern, the BCL and what Managed code is. You can't wing it anymore. To ask if you have to install the runtime where you run is like asking "Do I have to plug in the computer to make it run?" Managed code is managed. Managed by what? Managed by the CLR! You need one to run .NET code, ok? A runtime means just that. A runtime is needed at runtime to for programs to function.

The runtime is already offered as a Recommended Download on Windows Update, and it will be included in XP Service Pack 1.

BTW - That runtime would have been smaller if they didnt include DLL's to support legacy VB6 functionality.

EDIT: Added the quote for the benefit of those people too lazy to click on links.

[1]http://radio.weblogs.com/0105852/stories/2002/04/21/itsTheRuntimeStupid.html


"It is precisely because it is fashionable for Americans to know no science, even though they may be well educated otherwise, that they so easily fall prey to nonsense. They thus become part of the armies of the night, the purveyors of nitwittery, the retailers of intellectual junk food, the feeders on mental cardboard, for their ignorance keeps them from distinguishing nectar from sewage."
Isaac Asimov

[edited by - Arild Fines on August 13, 2002 8:10:52 PM]

Share this post


Link to post
Share on other sites
Exactly. Actually I hope MS will soon use a vehicle such as IE 7 or something (which gets downloaded and installed by a lot of people) to push out the framework.

Good installers (you DO use an installer, right?) are able to check the runtime existence and automatically download and install the framework - but ok, assuming you have access to things like Installshield 7.04 or WISE for Windows Installer might be a little far fetched in this forum.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites