Hello everyone,

I'm new to this...Last night I made a program in Visual Studio 2005, and when I brought it to school today to run, it wouldn't because they don't have .NET 2.0 installed...

Is there a way I can compile my program with the .NET 2.0 framework inside it? (Don't care about size)

Or what can I do? Apart from install the framework?

Dani AI

Generated

A short, practical primer that fills gaps in the replies from , , , , and .

Visual Studio 2005 builds target the .NET 2.0 CLR by default, so a program compiled there requires the CLR 2.0 runtime on the machine that runs it. That is why the application fails on lab PCs without .NET 2.0 installed. Visual Studio 2005 is not a drop-in way to produce a .NET 1.1 build; targeting CLR 1.1 normally requires building with the older toolset (for example, Visual Studio 2003 or the 1.1 compilers). (learn.microsoft.com)

If installing .NET on the lab is impossible, the two realistic approaches are (A) ship a bootstrapper/installer that will detect and install the .NET runtime before installing the app, or (B) reimplement the UI in a technology that doesn’t require the runtime. Visual Studio’s bootstrapper can create a setup.exe that checks for and installs the .NET redistributable as a prerequisite, so the runtime can be deployed alongside the app when IT permits installers. (learn.microsoft.com)

For the VB6 route mentioned by : the VB6 WebBrowser is the Internet Explorer/SHDocVw ActiveX host, so it depends on the system’s IE/MSHTML components. If ticking the component makes VB6 crash on school machines, likely causes are broken/missing IE components, registration problems, or lab policies that block ActiveX/registration. The WebBrowser control is part of IE and requires its underlying components. (learn.microsoft.com)

Quick troubleshooting checklist that can be done (by IT or an admin): check Event Viewer for the VB6 crash, run System File Checker, and re-register the browser/ActiveX DLLs (for example via regsvr32) if permitted. Example commands (run elevated):

sfc /scannow
regsvr32 "C:\Windows\System32\shdocvw.dll"

If full installers or admin fixes are blocked, consider an HTA (HTML Application) as a lightweight, no-.NET way to host HTML/JS/VBScript UI using the built-in mshta host. HTAs use the OS HTML engine and avoid the .NET dependency, though they carry their own security and policy considerations. (learn.microsoft.com)

Recommended Answers

All 12 Replies

Instead, figure out how to compile it without the need for the Framework. Then it can run on any Windows computer, with or without .NET

I was trying to remake it in VB 6.0 at school....But that doesn't allow you to add a web browser.

I need a web browser in it.

Install the .NET framework 2, there is no reason not to have it installed and it's easy enough.

You can get it here:

Install the .NET framework 2, there is no reason not to have it installed and it's easy enough.

The school will not install it...I reckon, and I probably don't have permissions.

Although they will have to install it next year (VCE program has been updated, so they get the latest software, probably visual studio 2005, as 2007 won't be out by then) I want it now :p

Although, I will try and install it myself, or ask the head of ICT

As I said...

Instead, figure out how to compile it without the need for the Framework. Then it can run on any Windows computer, with or without .NET

There was web access long before .NET, so don't use technology that is limiting you.

As I said...

There was web access long before .NET, so don't use technology that is limiting you.

Yes, but in the .NET framework you can just drag an internet browser in...

However, is it possible to compile in the 1.1 framework?

Yes, but in the .NET framework you can just drag an internet browser in...

You can certainly drag on a web browser in VB6.0. Look in the extended/full control list.. I'll walk you through because I don't remember exactly myself..

Right click your toolbox and hit components, or go to project > components; then browse through the list until you reach "Microsoft Internet Controls", check the box, and you'll have a new component in the toolbox called WebBrowser. Use it like this: WebBrowser1.Navigate("AN_URL")

Matt

You can certainly drag on a web browser in VB6.0. Look in the extended/full control list.. I'll walk you through because I don't remember exactly myself..

Right click your toolbox and hit components, or go to project > components; then browse through the list until you reach "Microsoft Internet Controls", check the box, and you'll have a new component in the toolbox called WebBrowser. Use it like this: WebBrowser1.Navigate("AN_URL")

Matt

Yah, When I do this it crashes.

Crashes no matter what school computer I do it on :(

does it give an error or does it just hang indefinately? does it crash when you drop the control or when you try to use it?

it may be the case that your school computers have firewalls and your application isn't in the list of programs trusted to use the internet.

i just tried it out (i use Norton Internet Security) and; while you're developing/debugging, VB6.0 needs to be granted permission to use the net (gives a low warning), and when you build the app (and i expect everytime you rebuild the app) it needs to be given the same permission (but gives a high warning).

you can test if that's the problem by trying to open a local file, but with regard to connecting to actual webpages, this'll probably be the case with any software you write in any language!

Matt

does it give an error or does it just hang indefinately? does it crash when you drop the control or when you try to use it?

Matt

Not when I use it..I tick the box, press OK or Apply and it crashes.

Hi,

There are 2 ways how to add .net framework redistributable into project - but it'll create an installer ;)
However, you can also use Delphi and you 'll have webBrowser component without need of installing any framework...

1 - Open project in VS, then click Project / [Project name] Properties / Publish / Prerequisites. There you can select .net Framework 2, which will be included in the project. (You'll have to put .net framework redistributable into Project's folder on your own, then show VS a path).

Then you'll have to click Build / Publish in main manu to publish your project.

2 - If you're using an app with more files, it's better to use a typical installer. The way to add prerequisites in there is:
Project / Properties / Prerequisites


This works in VS 2005 Professional. If you 're using the Express edition, then only first way may work for you.


Stevie

Every compiled program has dependencies. .NET programs require the .NET Framework. There is no way to write a program in th .NET environment without .NET Framework on the client machine, as WaltP keeps stating.

You could write in another language, such as VB 6.0, but it requires the vbrunxxx.dll as a dependency, and so on.

Any language that supports COM can re-use the Web Browser Control to have an internal web browser.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.