Visual Studio is locking the executable which needs to be built [duplicate] - wpf

This question already has answers here:
Error: Cannot access file bin/Debug/... because it is being used by another process
(30 answers)
Closed 4 years ago.
I am trying to run the application on which I am working and from time to time Visual Studio is not able to build the project only because it is locking the executable:
This started to happen after the last update of Visual Studio and it does not happen every build but just from time to time. Closing and reopening the solution removes the error temporary but after a few more builds it comes back.
I am trying to build a solution containing more DLLs and one WPF project and the error seems to be on the WPF one.
Does anybody know how to solve this problem in VS 2017?

I have added the bin folder to the antivirus exclude list, restarted the machine and now it seems to work. For a couple of days Visual Studio is not locking anymore the executable so as #Hans Passant pointed in his comment, it may not be a Visual Studio problem.

Related

Visual Studio Installer Setup Project [duplicate]

This question already has answers here:
Visual Studio 2017 setup project missing
(6 answers)
VS2017 Setup Project - Where?
(2 answers)
Closed 4 years ago.
I'm wondering how to use Setup Project in Visual Studio 15, which was in
Solution -> Add -> New Project -> .../installed -> Other Project -> Types -> Visual Studio Installer ->Setup Project
but this disappeared. To create an .EXE file for a Windows Form Desktop application, it seems like it is no longer available.
Or how can I access the same functionality with higher versions?
There is an extension that brings it back for backwards compatibility. But at the same time the guidance has been to finally move to a Wix installer or some other installer technology.
The Installer projects are considered deprecated and bad. They can't be easily built using a CI server and more issues.
The proper solution would be:
Use Wix Installer project (if you need Visual Studio project support)
Simple tutorial
Pluralsight
Use something like NullSoft Installer (just build the installer by building it outside of Visual Studio.
If you have an existing investment in the old style installer projects, you can still use the extension. If you're building something new. DON'T. It may be the simplest way of adding an installer, but it'll cause more issues in the long run.

Visual Studio 2010 Saving Projects

To All,
I haven't used a Visual Studio in quite a few years, and don't remember what version I had used. I created 15-20 libraries and 30-40 utilities - all in C.
I recently decided that I wanted to enhance some of the libraries and utilities and acquired Visual Studio 2010. I open an existing project (.dsw) and I get a popup that says "The project ' must be converted to the current ... Convert and open this project?' I click on Yes. I then get a popup that says "A file with the same name ... already exists on disk. Do you want to overwrite the project and its imported sheets?' Again I say Yes.
I go along my way and make a bunch of changes to the project. I click on "Save All." I then close the project and when I reopen, it is like I didn't change anything! I get the same popups again!
I've check the permissions on the directory and files and they should be writable. I have SCOURED the net trying to find out what I am doing wrong to no avail.
Any helpful pointers would be greatly appreciated!
TIA,
je
.dsw extension was used by Visual Studio 6, Visual Studio 2010 project files have extension .vcxproj. The conversion process mentioned in your question creates those new project files. Open them instead of old .dsw

Visual Studio 2013 crashing when saving Windows Forms solution

I have been working on a particular solution for a few months now without any problems. The last thing of significance that I remember doing was refactoring the name of a custom control inheriting from RichTextBox. I don't know if that is related to the problem but it seemed to be when the problems started occurring. For some reason now when I show the main form in design view and save any changes I get the message "Visual Studio has stopped working blah blah" and it restarts.
I seem to be able to load and make changes to other solutions ok.
So far I've tried:
Deleting .sln and v12.sln files
Have tried uninstalling NuGet. (I don't have any extensions other than NuGet and Visual Studio Extensions for Windows Library for JavaScript)
I don't have resharper
I have tried to start in /SafeMode but I keep getting the error "'Visual Studio Component Model Host Package' package did not load correctly". I can't seem to load any solutions in SafeMode.
Repaired VS2013 installation twice
Restarted my computer many times
Tried writing a log file using /log switch but can't really understand how to interpret it.
Any pointers would be very welcome.

How to detect unreferenced C/C++ code on Visual Studio 2005? [duplicate]

This question already has answers here:
Dead code identification (C++)
(7 answers)
Closed 9 years ago.
I've being using Visual Studio 2005 for several years, and usually projects grow and grow, but now I have a project that is going down size, I'm taking away a big chunk of it (almost half of it)... I expected that by deleting the entry point function the compiler would give me a list of unrefrenced functions which I would then delete, and so on until the whole unneeded code was completely deleted... but to my surprise no "unreferenced function" was listed.
I recall in the old days of Turbo C, the compiler immediately protested if there was a function that was not called anywhere... I don't understand why Visual Studio doesn't have this feature, I already checked the properties page throughout and can't find something to help me to get rid of the dead code in a systematic way.
Can Visual Studio detect dead code? if so, how do I enable such feature?
You can use code coverage to determine what parts of your program are being used. Of course you have to be careful because only the code paths taken in the instrumented run are taken into consideration. But anyway this can prove a good start in solving your problem.
Visual Studio 2010 Native C++ Code Coverage Coloring Not Working
I don't think you have C++ code coverage in Visual Studio 2005 but you can try converting your solution to a newer version.
http://msdn.microsoft.com/en-us/library/dd537628.aspx
Did you try enabling level-4 warning? Dead code is not linked into binaries by default, but you can enable warnings each time this happens:
http://msdn.microsoft.com/en-us/library/z85eyax0(v=vs.71).aspx

can we attach a process to VS programatically as soon as the process is created? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How to set breakpoint at the very beginning of program execution
I have an application in C. I am using VS 2008 for the development. I need to debug the C code by attaching the process with the Visual Studio. In normal conditions, the process can be simply attached, but here it is a bit tricky.
Following is the scenario:
The problem is that application gives some unwanted messages as soon as the application is run, i.e. PROCESS is created. The time is too small to get the PID and attach it to the VS.
My question now is:
Can we do something( write some program or there is some workaround) so that we can attach the process as soon as it is created?
Thanks in advance.
Regards,
Abhishek Anand
The easiest way to do so is to set a break point in the start of your source code, and use the Visual Studio to start debugging the application. You can use F5 or Debug|Start Debugging menu item to do this.
If you have to wait for another process to start your erroring program, then download and install "Debugging Tools For Windows" if you have not already got it. It can be found here: http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx
It is free debugging tools from Microsoft for debugging on all supported Windows OS.
It includes an utility called GFlags. Use GFlags to set the automatic debug options on your target program. This is the easiest way to set your system to start a debugger that will automatically be started up when the target application starts. I prefer to use WinDbg.exe (it is included in the tools package), but you can have Visual Studio start up as your debugger if you prefer.
The link above includes links for Debugging help.

Resources