Problem when compiling.
I use VS with the latest version and C#.
I use a project that uses several dlls. I have marked Debug F9 lines and compile the dll that I have modified but, when executed, it does not stop at the Debug lines and acts as if it used the previous code.
I have recompiled all the dlls again and, sometimes, it acts the same way, but other times it recognizes the lines and acts as if it were using the new code.
For the main exe and for the dll of the active project I use "Local Copy:Yes" and for dlls that are not from the active project I use: "Local Copy:No".
Another problem is that before I pressed F5 to continue being in a Debug line and now it doesn't work and I have to press the "Continue" button.
Before updating to version 17.10.3 and 4 it did not act this way.
Visual Studio
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-07-16T08:50:48.43+00:00 Hello, what is your project type? Could you create a new simple solution and check if this issue also reproduces?
Please close all running VS instances and try to manually delete the hidden .vs, bin and obj folders in the project folder. Then, reload the project.
You can also try to repair your VS with Visual Studio Installer.
-
zequion 446 Reputation points
2024-07-22T00:21:28.57+00:00 I have cleaned all the projects and the problem continues. If I modify something and compile that dll, it does not stop at some F9 and acts as if the code were the previous one. I have to compile everything several times for it to recognize the new code and stop at F9. If I compile once, it usually doesn't work.
If I modify a .cs and compile everything says "2 updated". From there, if I recompile everything, it always says "1 updated". This has started happening since version 17.10.3
If I compile only 1 .cs, the first time it says "1 correct 0 updated" and the next ones it says "0 correct 1 updated".
-
zequion 446 Reputation points
2024-07-22T05:03:19.3+00:00 I have realized that if I make any changes to a dll, then I also have to compile the main project. So it does recognize the new code. In "Tools", "Options", "Projects and Solutions", "Compile and Execution", "When running, when projects are not updated" I have "Always compile" activated. The "Compile startup projects and dependencies only on run" option is unchecked.
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-07-22T13:12:39.67+00:00 Hello, is your issue resolved?
-
zequion 446 Reputation points
2024-07-22T22:30:19.6433333+00:00 No, every time I modify a dll I have to manually compile the main project or it doesn't recognize the changes. The project includes the dlls as a "local copy" because otherwise the project does not start because Xamlreader.cs void RewrapException() fails.
-
zequion 446 Reputation points
2024-07-23T02:22:34.41+00:00 I modify a dll and compile it. If I run the project without compiling it, it doesn't have the dll changes and VS doesn't compile the project itself.
I have "When running, when projects are not updated" -> "Always Compile" enabled and the project dlls are in "Local Copy".
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-07-23T10:32:08.06+00:00 Do you mean, when you set DLL’s “Copy Local” property to “True” in your project, any changes to those DLLs require the main project to be rebuilt?
If the 'Only build startup projects and dependencies on Run' (Tools > Options > Project and Solutions > Build and Run) is checked, any difference?
-
zequion 446 Reputation points
2024-07-24T00:26:30.07+00:00 It makes no difference if I check or uncheck that option.
For example, if I make some change to a dll and put F9 Debug lines and compile the main project, it works correctly and stops at the Debug lines.
If I make another change to the Dll and only compile the Dll but not the project, it does not stop at the Debug lines and acts as if it were using the previous code. If I put new debug lines, it doesn't stop at them.
The project adds all dlls as "Local Copy". If I modify a dll, compile it and run the active project, it does not compile the project before running.
The project is written in C# and I have it in the .Net 8 version and the .Net Framework version and it acts the same in both versions.
-
zequion 446 Reputation points
2024-07-24T00:51:48.27+00:00 If I make a change to the same MainWindow.Xaml.cs (WPF) startup file, it is not used until I manually compile the project.
-
zequion 446 Reputation points
2024-07-24T01:11:00.6333333+00:00 In "Compile", "Configuration Manager" I have everything unchecked.
-
zequion 446 Reputation points
2024-07-24T01:14:08.94+00:00 In "Compile", "Configuration Manager" I have everything unchecked. If I check the box with the current project, it compiles and works correctly. But I have several projects and I change from one to another, so I would have to uncheck the above all the time so that it doesn't always compile.
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-07-25T09:28:50.94+00:00 Hello, can you try to create a new simple solution and check if this issue also reproduces?
-
zequion 446 Reputation points
2024-07-30T22:18:24.4666667+00:00 For example, in a c# Wpf project in Net 8, if I modify Mainwindow.xaml.cs, it does not recognize the changes until I compile. What is the solution to recognize that the project has been modified and compile it automatically, because I have to be compiling the dll and the project all the time.
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-08-01T09:43:56.5466667+00:00 Hello, after editing the file, did you save it? You can click on File > Save All (Ctrl+Shift+S).
Besides, if you didn't check the "Build" for some projects in the Configuration Manager, by default, VS won't build these projects.
-
zequion 446 Reputation points
2024-08-01T09:54:10.3133333+00:00 Yes, I do. I have a solution that contains several projects and sometimes I switch between them. That's why I don't want to specify a project to compile and I prefer it to detect if there have been changes and compile it.
-
Anna Xiu-MSFT 29,511 Reputation points • Microsoft Vendor
2024-08-02T07:13:01.7533333+00:00 Hello, please go to Tools > Options > Environment > Documents > ensure the following options are checked.
-
zequion 446 Reputation points
2024-08-04T00:44:50.0733333+00:00 It didn't work. Any more ideas?
Sign in to comment