Starting a few months ago I noticed that when a WPF project is out of date, it builds much more slowly than other projects. This seems to have started with Visual Studio 2012, though I'm not positive about that.
So my question is, are there any settings or tools I could use to help diagnose performance problems with the build process? I have enabled extra logging for C++ projects in the past to determine why VS thinks a project needs to be rebuilt when it hasn't changed. Is something like that available for other types of projects?
Related
at the moment I‘m very frustrated while developing at work. We‘re working in a visual studio 2019 solution file with 290 projects in it. Our software is written in C# using .NET code.
I‘m getting even more frustrated every time when I change a branch of the git repository, because the visual studio then starts a whole reload of the solution which takes up to 5 or 10 minutes.
Do you know if there is a limit for the amount of projects in a visual studio solution? Or did you work within solution with a higher amount than 300 projects?
While there is no enforced limit (in theory you can have thousands of projects in a solution file and visual studio will try to load them) there are some, as you can see here: Recommended number of projects in Visual Studio Solution
Machine limits. After a certain number, non powerful machines take to much to load or even crash.
Older vs version have been reported to crash after a certain number (even lower than yours)
Manageability is also a concern. Too many projects sometimes mean that there should be a better separation of concerns. Having them all in one solution sometimes brings unneeded coupling between unrelated codebases.
If number 3 is not the case, I'd advise you to create multiple solutions, each a subset of the projects per domain area.
If it is, try to refactor and decouple. Each decoupled dll should be moved outside the solution, packaged into a nuget and consumed independently.
We have a moderately sized solution, with about 20 projects. In one of them I have my business entities. On compiling any project, visual studio waits and hangs about one and a half minutes on this BusinessEntities project.
I tried our solution in SharpDevelop and it compiles our complete solution, in 18 seconds. Similar timing with MSBuild.
My guess is that VS is trying to find out if the project needs a compile, but this process is about 15 times slower than actually performing the compile!!
I can't switch to the great sharpdevelop, it lacks some small, but essential requirements for our debugging scenarios.
Can I prevent VS from checking this project, And have it compile the projects without such a check, just like sharpdevelop?
I already know about unchecking projects in configuration management to prevent building some projects, but my developers will forget they need to compile this project after updating to latest sources and they face problems that seem strange to them.
Edit: Interesting results of an investigation: The delay happens to one of the projects only. In configuration manager I unchecked all projects, then compiled each of them individually. All projects compile in a few seconds!! The point is this: if that special project is built directly, compiles in a few seconds, if it is being built (or skipped, because it is up-to-date) as a result of building another project that depends on it, VS hangs for about a minute and half, and then decides to compile it (or skip it). My conclusion: Visual studio is checking to know if any files are changed, but for some reasons, for this special project it is extremely inefficient!!
When I build a C# program (this has been going on for several different solutions/projects I have been working on) in Visual Studio 2017, the new, updated code will build and run in debug mode (and run correctly).
However, the application that Visual Studio has been outputting when I build/debug them has been remaining with the original, first version of code that I saved. When I choose the options to rebuild, it will update the time stamp on the application and .pdb files, but the application will perform the way it did in earlier code versions, not the most recent code version that was running problem when I ran debug mode immediately after pressing Ctrl + F5.
These are C# Console Apps with the .NET Framework 4.6.1, if that makes any difference. I checked the output folder, and it is indeed the desired folder and the one I have been looking in... so why is the time stamp updating on the application (.exe file) that it outputs, but not the code itself? What am I missing?
When I run into strange things like this in Visual Studio, the first thing that usually works is to clean the project and rebuild. If that doesn't work, I'll close Visual Studio, re-launch, then clean and rebuild again. If that doesn't work, I would start looking into any extensions you have installed that might be getting in the way of your build process.
Further, you can look into logging the extensions activity to help troubleshoot if there are issue there. See the following article:
https://blogs.msdn.microsoft.com/visualstudio/2010/02/24/troubleshooting-extensions-with-the-activity-log/
You may have already tried this, but since it wasn't mentioned I thought I'd provide it for others in a similar situation.
Two possible reasons:
(1) Your project was not recompiled during debugging. Please enable Edit and Continue under TOOLS->Options->Debugging.
(2) Visual Studio has a concept of incremental build. If you have a solution with two or much more projects and if you change source code in only one of the two projects, the "Build" command will compile only the modified project. But the "Rebuild" command, on the other hand, it will recompile all projects in this solution.
For some reason, conditional breakpoints suddenly became disabled in one of my project. I'm having a hard time to find any documentation on internet on the potential conditions that could disable these options. Anyone know why it became disabled, and how to fix it?
Here are some information:
It's a C# solution with about 50 C# projects, and a few shared projects and C++ projects (No project added/removed recently)
I use Resharper 8 on Visual Studio 2013 with Update 4
Closing/reopening Visual Studio didn't solve the problem
I just jumped back into a project that previously had no issues. We just upgraded to visual studio 2012. This morning I open my project to work on my code. I am getting designer issues all over the place.
"If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU"
It all seems to be coming from this platform issue. I have had zero issues in the past. I cannot find any information on how to fix this. I even go to open the designer on a file that previously worked (pre VS2012 install) and that fails.
So I went back to VS2010...without changing anything and attempted to open the same designer on the same file that previously worked and I also get an app crash.
Did somehow my visual studio 2012 install cause all of this?
Make sure that you are choosing the right CPU architecture for your designer. If it is ARM then you might see that message. You can check your CPU settings for your project like this: