开发者

How to check code is compatible with Windows 7

We are developing using Visual C# 2008 Express a开发者_如何学Go 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.


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!


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.


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜