C# – Trouble loading a C# app on another machine with .Net 2.0 service pack 2

assembliescnet

I'm not really a C#/.Net developer, but I've been asked to solve an issue we are having. We have a small command line app in C# that has been working and recently ran into trouble. On my machine I can build and run it, but when I try to run it on some of our servers it fails. I looks like it fails on the ones that have .Net 2.0 with service pack 2 installed. I don't have this service pack.

Here's the error that we see:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.File name: 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

As far as I can see the system references are set to Specific Version: False.

Best Answer

Have you packaged the application into a setup? Using a Setup project will usually ensure you have all the required dependencies installed.