When I came back this morning, I found that the Windows service I wrote needed to be modified and I used installutil/u to uninstall the service. When you use installutil for installation after modification, the installation fails: the specified service has been marked for deletion.
Of course it is depressing, but I still have Google, so I found the following explanation on the msdn English website:
Once you have the post-build event in place, you'll need to keep in mind that every time you build, it will make the installutil callautomatically. don't leave your Services window open when you're building or running installutil or you cocould get a highly mysterious error: "the specified service has been marked for deletion."
That is to say, when you run installutil, do not open the computer management window; otherwise, the above error will occur.
This is the case. After the Management window is closed, the installation is successful. Which of the following friends may encounter similar problems? Can you see if the management window is opened.