Exception on deployment of application

S

Simon Jefferies

Hello,

I have written a VB.NET application and created a setup project for it. I
have deployed this project on to Windows XP (no service pack), and when I
run a specific form, I get an unhandled exception has occurred in your
application. The error message relates to "External component has thrown an
exception". In the details box the exception text relates to
System.Windows.Forms.UnsafeNativeMethods from
System.Windows.Forms.Application.RunDialog().

TIA
Simon Jefferies
Tools Programmer, Headfirst Productions
 
S

Simon Jefferies

I have NetXP and a couple of Infragistics controls, they are listed in the
references and come up in the dependencies section of the setup project.

Simon
 
F

Felix Wang

Hi Simon,

Thanks for posting. First of all, I would suggest that we apply the latest
service pack and security patches for the Windows XP machine in problem. It
is always a good practise to keep the system up-to-date.

In your program, do you use the "Application.EnableVisualStyle()" method?
We have some past records that calling the method unappropriately may cause
this error. We should call this method before showing the forms.

There are some third party controls and components involved. Let's try to
isolate the problem:

1. Find another Windows XP machine and try the application, do we have the
problem?
2. If we remove the third party controls from the form and rebuilt the
application, do we have the problem?
3. Is it possible that there are some license requirements for
redistributing these third-party components? As far as I know, Crystal
Reports' merge modules need a specific license key to build in the Setup
projects.

I hope the information is useful to you. If you have any concerns or new
findings, please feel free to post here.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
F

Felix Wang

Hi Simon,

Is there any update on this issue?

Should you have any concerns or new findings regarding this issue, please
feel free to post here.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
S

Simon Jefferies

Hello,

Thanks for your replies,
Thanks for posting. First of all, I would suggest that we apply the latest
service pack and security patches for the Windows XP machine in problem. It
is always a good practise to keep the system up-to-date.

I've applied all the latest service packs etc and made no changes. I am
running Windows XP professional through Virtual PC 2004 for testing
purposes. Will there be any problems using this piece of software?
In your program, do you use the "Application.EnableVisualStyle()" method?
We have some past records that calling the method unappropriately may cause
this error. We should call this method before showing the forms.

Yes, I call Application.EnableVisualStyle() method in the Form_Load event.
1. Find another Windows XP machine and try the application, do we have the
problem?

Currently, we don't have another XP machine as yet to test on.
2. If we remove the third party controls from the form and rebuilt the
application, do we have the problem?

I get the error when the main form starts, works fine with standard
controls.
3. Is it possible that there are some license requirements for
redistributing these third-party components? As far as I know, Crystal
Reports' merge modules need a specific license key to build in the Setup
projects.

I have noticed that I have CrystalDecisions dependencies in my "References"
section of the project.
How do I specific a licence key for the setup project?

Thanks for your help.

Regards
Simon Jefferies
Tools Programmer,
Headfirst Productions
 
F

Felix Wang

Hi Simon,

It is not appropriate to put the Application.EnableVisualStyle() method in
the Form.Load event. To have an effect, EnableVisualStyles must be called
before creating any controls in the application; typically,
EnableVisualStyles is the first line in the Main function.

To get a license key of Crystal Reports components, I think you need to buy
one from Crystal Decisions.

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
S

Simon Jefferies

The Crystal Reports components that I am using came with Visual Studio .Net
2003, does this contain a licence or is it limited?

Regards
Simon
 
S

Simon Jefferies

The Crystal Reports components that I am using came with Visual Studio .Net
2003, does this contain a licence or is it limited?

Regards
Simon
 
F

Felix Wang

Hi Simon,

If this is the case, you may try the key from VS.Net's "Help" | "About"
dialog.

It is a 19-digit key for "Crystal Reports for Visual Studio .NET".

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
S

Simon Jefferies

Where do I place this key to? Is it something to set in the Setup project?

I've moved the Application.EnableVisualStyle() function out of the .Load
event and this has solved a number of issues.

Thanks
Simon Jefferies
Tools Programmer
Headfirst Productions
(e-mail address removed)
 
F

Felix Wang

Hi Somon,

You can use the key when you include the merge modules into your Setup
project. For "Crystal_regwiz2003.msm" or "license.msm" (depending on which
version of Crystal Reports you have), there is a license parameter property
for the merge modules. You may refer to the following guide for detailed
information:

Crystal Reports and Visual Studio .NET - Application Deployment
http://support.businessobjects.com/communityCS/TechnicalPapers/crnet_deploym
ent.pdf.asp

I hope the information is useful to you.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top