0

I was coding a project in C#, one that interacted with a .csv file and converted it to a form of .xlsx from a template. This was using C# WinForms in visual studio 2008. It worked just fine on my Windows 7 64-Bit machine with Excel installed, and same for my supervisor's computer. However, moving it back to Windows XP, it failed.

My question is what do I need to do to make it multi-platform like that? Does the target computer need to be 64bit as well? If so, how do I make my project 32-Bit instead? And would it need the Excel installation of some kind as well?

Update: There are references in my program to things in the Windows Assembly, and I don't believe they are on the target computer. Is there a way to package them with the .exe in some way so that it can be run on another machine?

user3215251
  • 239
  • 1
  • 16
  • Please describe what `it failed` means. Any errors? Any debug information? – Jite May 20 '14 at 11:10
  • When I double clicked on the .exe file on Windows XP, it immediately went into error saying I believe system.io file not found. The error had randomly positioned numbers in it as well that I could not decipher. – user3215251 May 20 '14 at 11:12
  • Any missing files? Possibly a `FileNotFoundException`? – Jite May 20 '14 at 11:13
  • Not that I know of. I brought over JUST the .exe and the xml file over to the Windows 7 machine and it was fine, but on Windows XP with the same setup it failed. – user3215251 May 20 '14 at 11:17
  • What `.net` version are you using? Is the correct version of `.net` installed on the xp machine? – Jite May 20 '14 at 11:18
  • That was a curious thing. I apparently made this projectin .Net 3.5. I installed .Net 4.0 on the XP machine. Should I have installed .Net 3.5 instead? (Sorry, I assumed it might be backwards compatible, which I'm just now realizing might be a huge mistake...) – user3215251 May 20 '14 at 11:21

1 Answers1

2

Few things to check

Check AnyCPU in the Visual Studio Project settings, review this http://msdn.microsoft.com/en-us/library/office/ff407621(v=office.14).aspx

Check if MS office is installed in Win XP Machine, as well as what version, if your application uses MS office DLL then you might be facing "DLL Hell problem", check exact version

Try to debug by putting log or removing references or commenting code.

Nipun Ambastha
  • 2,553
  • 1
  • 16
  • 26
  • In regards to the DLL, there are two Excel DLLs that I brought over onto the XP machine, and had them in the same folder as the .exe. Could it be that they needed to go somewhere else? – user3215251 May 20 '14 at 11:30
  • See this : http://stackoverflow.com/questions/10477977/what-reference-do-i-need-to-use-microsoft-office-interop-excel-in-net – Nipun Ambastha May 20 '14 at 11:32