INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

.Net 4 application won't run on Win XP SP3

.Net 4 application won't run on Win XP SP3

(OP)
Hi guys,

I'm having a bit of a problem here. I write tools for various tasks and want to enable other people to use these tools, too.
Alas, for various reasons some people still need to work on Win XP machines (SP3, .Net 4 extended + client installed) - and my tools fail to run on these machines.
I am currently trying with one fairly simple Windows Forms application.
Background info on what I've attempted to make it work:
  • set config to x86 instead of 64 bit
  • made sure Framework 4 (not client) is selected as target
  • switched from VS 2012 to VS 2010
  • set target consecutively down to Framework 3.5, 3, then 2
  • for downgrading, removed unused references to Linq, Threading and Microsoft.CSharp
  • reduced .ico size from 256 to 64 px
  • replaced the .png displayed on the form(s) with a .jpg
Still to no avail. The tool will compile and run nicely on Win 7 machines but will fail on Win XP SP3 (i.e. will not start up "xyz has encountered a problem and will quit").
At first it wouldn't even display the icon for the .exe, that has been solved by the second-to-last step.

I am not using any third-party assemblies, all native .Net.
Functionalities used in the application:
- ListBox and TextBox with drag/drop
- Regular expressions
- XML DOM handling (no Linq)
- StreamReader/Writer
- small PDF embedded as Resource (manual)

References: System, System.Core, System.Data, System.Deployment, System.Drawing, System.Windows.Forms, System.XML
+ using: Colections.Generic, Componentmodel, Text, Text.RegularExpressions

Running out of ideas here.
Anyone know what's cooking?

Thanks & regards,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: .Net 4 application won't run on Win XP SP3

(OP)
A little update on this:
I have installed Upgrade 3 for VS 2012 - no result.

Another rather curious thing: I am using a reg query to determine whether .Net is installed and which version:

CODE

reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP" /s /v version | findstr /i version | sort /+26 /r 

Running this on any XP SP3 machine gives an error message "too many command line parameters".
Does this ring a bell with anyone?

Thanks & regards,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: .Net 4 application won't run on Win XP SP3

(OP)
SOLVED!!!
peace

Using about a dozen try-catch blocks and writing exception + position to an errordump file, I managed to locate the problem:
The app crashes on resources.GetObject("$this.Icon") in the InitializeComponent method of the Form Designer.
By default, VS generates a line like this:

CODE

this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 

Works fine on Windows 7 but not on XP!

I solved this by importing the icon file into my Resources, then replacing this line in Form Designer with:

CODE

this.Icon = global::[mynamespacegoeshere].Properties.Resources.logo; 
Where "logo" is the name of your icon resource.

MS <XOR> logic... poke

I hope it'll save someone else's nerves one day...

Cheers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: .Net 4 application won't run on Win XP SP3

(OP)
Ahem...
I just learned that InitializeComponent must not be edited manually...
blush


Ergo: no direct assignment of logo, but instead:

CODE

private void Form1_Load(object sender, EventArgs e)
        {
            this.Icon = [mynamespace].Properties.Resources.logo;
        } 

*sigh*

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close