Share via

Problem with 2019 Visual Studio

Washington Peralta 0 Reputation points
2026-02-14T19:02:28.61+00:00

From:                    Washington Peralta

User of Visual Studio 2019

To:                                                       Microsoft Customer Service

Subject: Asking for help because I am having a problem using Visual Studio 2019

 

1.)    I compile a program, and the program compile successfully

2.)    I run the program, and the program run ok

3.)    I make a slight change to the program: inside a phrase between quotation marks I add 5 blank spaces

4.)    I compile the modified propgram and the compilation is ok

5.)    I run the modified program, and the modified program doesn’t run; it appears a little window with the text

Microsoft Visual Studio

! There were build errors. Would you like to continue and run the

Last successful build

YES                                                                                                                  NO

6.)    I make click in NO and it appear the errors MSB6006 and LINK1168

 

Severity                                                                                                                         Error

Code                                                                                                                                             LINK1168

Description                                                                                     cannot open C:\Users\peral\source\repos\WSB-CH-02-28\Debug\WSB-CH-02-28.exe for writing

Project                                                                                                                          WSB-CH-02-28

File                                                                                                                                                C:\Program Files (x86)\Microsoft Visual

 Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets

Line                                                                                                                                                              1074

Suppression State                          

 

Severity                                                                                                                         Error

Code                                                                                                                                             MSB606

Description                                                                                     "link.exe" exited with code 1168.

Project                                                                                                                          WSB-CH-02-28

File                                                                                                                                       C:\Users\peral\source\repos\WSB-CH-02-28\LINK

Line                                                                                                                                                              1

Suppression State                          

 

Please could you help me to find a solution to my problem?

Thank you in advance.

Best regards.

Washington Peralta

******@gmail.com

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 83,581 Reputation points Volunteer Moderator
    2026-02-14T20:39:04.4433333+00:00

    Most likely, the exe is still running, so the build can not write the new exe. Check with process list if still running.

    0 comments No comments

  2. Washington Peralta 0 Reputation points
    2026-02-14T19:11:10.88+00:00

    I am happy, I have applied the solution

    Clean and Rebuild: Try cleaning the solution and then rebuilding it. You can do this by going to the menu and selecting Build > Clean Solution, followed by Build > Rebuild Solution.

    and It have worked perfect.

    Thank you very much

    Washington Peralta

    0 comments No comments

  3. Q&A Assist
    2026-02-14T19:02:39.0166667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems that you are encountering build errors in Visual Studio 2019 after making a minor change to your program. The errors you mentioned, specifically MSB6006 and LINK1168, indicate that the linker is unable to open the executable file for writing. This can happen for a few reasons:

    1. Executable Already Running: Ensure that the executable (WSB-CH-02-28.exe) is not currently running. If it is, close it before trying to build again.
    2. File Permissions: Check if you have the necessary permissions to write to the directory where the executable is being created. You might need to run Visual Studio as an administrator.
    3. Antivirus Software: Sometimes, antivirus software can lock files that are being created. Temporarily disabling the antivirus or adding an exception for your project folder may resolve the issue.
    4. Clean and Rebuild: Try cleaning the solution and then rebuilding it. You can do this by going to the menu and selecting Build > Clean Solution, followed by Build > Rebuild Solution.
    5. Check for Other Errors: Review the Error List in Visual Studio for any additional errors that may be affecting the build process. You can access it from the bottom of the build Output window.

    If these steps do not resolve the issue, you may want to check the project settings or consult the Visual Studio documentation for further troubleshooting guidance.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.