views:

128

answers:

5

Hello,

We are developing using Visual C# 2008 Express a program based on WPF under Windows XP machines (32 bits).

The thing is that we have tried to run the program in two Windows 7 machines, one is 32 bits Windows 7 and the other is 64 bits Windows 7.

Under Windows XP everything is fine. In Windows 7 machine, it launches in the 32 bits version altough there is an error when running one functionality (it does not happen in XP).

In W7 64 bits it even does not launch. Is this normal? Is not possible to run 32 bit programs under W7 64-bits,even if they execute slower??

How can we check the code is compatible with Windows 7?

Thank you very much in advance.

Julen.

A: 

I think it's not a question of compatibility. Windows 7, both 32bit and 64bit should be completely compatible with C# WPF apps. And it won't run visibly slower on the 64bit os.. You shouldn't notice any degradation.

If your app is crashing on Win7 check your code, check the exceptions it's throwing.. I'm almost confident the culprit is there.

Artiom Chilaru
The thing is we can not afford now a new W7 license to debug the code. Anyway, we are doing some test with message and it look likes a database issue. Our app is small and uses Access database. We have included the JET Access "plugin" so we can connect to the database regardles if the target computer has Access or not. Should we include a W7 specific JET Access? We are quite struggling with Access but it is "compulsory" it use. Thanks!
Julen
Ahah! Ms Access :) Check the new answer I posted on top
Artiom Chilaru
A: 

I had the same iseeu when I developed an hobby project of mine in Win XP 32 bit and tried running it in 64 bit Vista. The app didnt even start and started throwing error sometimes even though the target cpu was set as "Any CPU".

Now I develop with a Win 7 machine (64) bit and I set the Target CPU as "Any CPU". It ran without any issues in Vista and XP (both 32 bit and 64 bit).

you can also taget only "32 bit" mode. Your app wont have any performance issues.

I would suggest you to open the app in a Windows 7 pc and then debug or recompile and test it in lower versions like Vista and xp.

Shoban
Thanks! Please see the answer above.
Julen
+2  A: 

I agree with Artiom and see only one valid answer: Test it on Windows 7. We could write down a list of possible problems here (and I'll do in a second), but you still need to

  • Test your software on the relevant architecture
  • Check the error messages/conditions yourself

Possible changes, between XP and Windows 7:

User Access Control (UAC): This means that your program doesn't run with administrative rights, unless you

  • explicitly start it like that
  • require administrative rights in a specific manifest resource that is supported in Vista/Windows7

This means also that your application cannot write to some folders (UAC tries to "help" you with "Virtual Folder Redirection": If you write to %ProgramFiles% it silently writes to your user profile and "succeeds". If another user expects to see your change in the %ProgramFiles% directoy though it won't be there), without even getting an error.

Regarding your specific reports and problems:

1) Give more details regarding that functionality. Maybe it depends on a DLL that is not present on Windows7 (but was on every XP machine). Maybe it's just related to permissions (see above). More details -> More help.

2) Again, more details. Possible candidate: Your application runs as 64bit application, although it has hard/early dependencies on 32bit native DLLs via P/Invoke. Again, you provide not enough information.

Benjamin Podszun
Thank you all! We have moved the code to a W7 based computer and debug the code. As you mentioned it happens to be a problem with the permissions when trying to update values in the database. We tried to change the permission of the file programatically in the code but we cannot or do not know how to do it. Do you if it is POSIBLE to do? The database file is under Program Files folder by the way.
Julen
Well, change that. You are not supposed to write to the Program Files folder. If it is something specific for a user, write to their profile. If it's something of value for the whole machine, use the ProgramData directory. Check this blog post: http://blogs.msdn.com/cjacks/archive/2008/02/05/where-should-i-write-program-data-instead-of-program-files.aspx
Benjamin Podszun
+3  A: 

Ok, as the user provided some more info, I believe the culprit has been found. The client uses MS Access database in their app (the standard MS Jet provider). The problem is that Microsoft does not have a 64 bit version of the MS Jet provider, and WILL NOT do it. Don't know why :)

So to make the app run on windows 7 64 bit do this: in Visual Studio go to the project properties, and in the Build tab, Platform target change Any CPU to x86. This will force the app to be compiled in 32bit only mode (will run under WOW64 on Win7 64), and the app will be able to access the Access database. I believe this is why it wasn't running on the 64 bit os :)

Regarding the "there is an error when running one functionality", I recommend getting more details about the error, and creating a new question with it.

Have fun, and Good Luck!

Artiom Chilaru
A: 

In addition to the previous posts: To help you find issues with your application, there's the Application Compatibility Toolkit.

Daniel Rose