SoFunction
Updated on 2025-03-07

Solutions that the program written by VS2010 can run on your own computer but cannot run on other computers

Later, I searched online and said that I changed it to using mfc static link. I also changed it accordingly and then generated the release, but it still did not respond on other people's computers.

I had no choice but to continue searching for the results online, and finally decided whether it was the .net framework version. The Internet said that changing to 2.0 version could solve it. Then I opened the project properties and found that the target Framework was directly displayed 4.0, and there was no drop-down bar... Moreover, the configuration and platform options of my general attributes are not applicable... I created a new mfc project, and there was a .net version that could be selected above when creating the new menu. I chose the 2.0 version, but after opening the attributes, it still showed 4.0!

After continuing to search online, I learned that after installing .net framework 3.5 sp1, I can solve the problem. Then I started to install .net 3.5 sp1, but I can't afford to install whether it is to download the online installation version or the complete installation version. There are three situations:

1. No matter which installation is clicked, there will be no response...and no corresponding process
2. After several reboots, I finally responded, but after a while, I was prompted that I had to use "Open or Close Windows Function" to install or configure .net 3.5. I also did as I did, constantly hooking it in "Open or Close...", restarting, opening vs2010, and there was no change. Remove it, restarting, opening vs2010, and there was only one option for 4.0 when creating a new project. Then remove it, restart, open vs, and return to its original appearance. It still doesn't work. After repeating it many times, I was completely speechless.
3. Continue to search and find that win7 comes with .net 3.5, but I just can't use it! ! Then I continued to remove the .net 3.5 hook in "Open and close windows function", restart, and install .net 3.5 sp1. He finally entered the installation, but was blocked by the program compatibility assistant when it was more than halfway through the installation! ! Say .net framework 3.5 sp1

What system will not start if the language pack package causes... Then I went to the official website to download the .net framework 3.5 sp1 language pack 64-bit installation package, and it was blocked if it was installed separately! (Quoted from Baidu here)
1. First, you can make the simplest program to test it to see if it can be successfully released. If possible, the second step is to check the procedure. The third step is to copy it to a machine with the same environment to see if it can run. (If not, it means there is a problem with your environment)
2. If the release cannot be successful, check your environment or your vs configuration.

The problems I encountered are as follows:

1. It can run on this machine, but it cannot run on other machines. It will appear for about ten seconds in the thread and will be automatically killed. It is probably a problem with the program. Then I copied the code to another machine to run, and the absolute path actually appeared (I think I am very SB) and I commented out weakly. It just didn't work until it was dark.

What problem did you find? It's right, it's my path. How did I use the absolute path? Is it careless or not?
2. It is worth noting that I actually have resource files that have not been copied into it. Copy, past, done

Summarize:

1. Start the simplest test when encountering problems
2. Never write an absolute path, it will kill people
3. Think about it and then take action. Don’t be perfunctory when there is a problem. The root cause of the problem is that. Think about why the error is reported.
4. The place where the file is opened (I ignored it here), the data connection must be thrown.