My .NET framework 4.6.1 console application works fine on my friends computer but after cloning the repository and running it on mine it seems to not want to compile. Everything still works the same as it did when I tried debugging and noticed it wasn't working.
Any other application I try compiles fine, this is a bug with this project only.
Extra details, as I was told I didn't example enough?
I've tried compiling it pretty much every way, clicking the Start button with the green triangle, F5, CTRL+F5 and none compile the code. It runs just as it would if it worked, it just doesn't apply changes I've made in the source code when debugging. I'm using Visual Studio 2015.
In Visual Studio, go to Build > Configuration Manager
With Active solution configuration set to Debug, make sure that your console application project has the Build checkbox ticked. This is usually ticked by default.
Otherwise you can explicitly build your project by selecting Build > Build ProjectName (Shift+F6) or right-clicking your project in the solution explorer and selecting Build from the context menu.
Related
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.
I've got a C#/WPF application which was originally built in Visual Studio 2012. Eventually we upgraded to Visual Studio 2015 and that worked fine. Lately I've upgraded further to Visual Studio 2017 and now I'm having lots of problems. I've got the drop-down options set to "Debug," "Mixed Platforms," and my project name, and when I hit Start it does indeed start up my project. However any recent changes I make to the project don't get reflected.
At first I was wondering why a TouchUp event handler I had added wasn't seeming to be hit. Then after further experimentation, I changed one of the existing log messages slightly (we have a logger that logs to a local text file). However, it continues to log the old message. Another symptom of this is that none of my breakpoints get hit. When I add them it shows up as the standard red circle, but as soon as I press start they change to a white circle with a red perimeter, and the tool-tip hint says that it cannot hit the breakpoint because the source does not match what is running.
This is extremely frustrating as the debugger is one of those things that should just work. Has anyone else run into anything similar after upgrading to VS'17? Any advice?
So I found a workaround to my problem, but not a solution. When I deleted the files from the "bin" folder, it just stopped working altogether. So instead I manually built the project using MSBuild, in the C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin folder. The two commands I ran in succession were:
MSBuild.exe /target:Clean /p:Configuration=Debug /p:Platform="Any CPU" MySolution.sln
MSBuild.exe /target:Build /p:Configuration=Debug /p:Platform="Any CPU" MySolution.sln
In fact, I don't really need to do the "Clean" step every time, and this works. However it's really quite slow and I am genuinely surprised that VS apparently isn't doing this automatically, under the hood.
When trying to run Build / Rebuild in Visual Studio on a solution, nothing happens.
I can run the build from the command prompt using MSbuild.exe, and this gives me the output i would expect (Build succeeded) - But when trying to run it from visual studio, nothing happens. Theres no debug output or build output either.
The project is a MVC project, with some references to other projects.
I can create a new MVC project, and it runs just fine!
Any idea what might trigger this behavior?
Using Visual Studio 2015.
I Have tried the following:
Restarting VS
Comparing the solution file to a new solution file
Triggering build manually from MSBuild (OK)
Switching Debug / Release configuration
Building projects individually
Updated NuGet
Build Configuration is OK (Everything checked for Build)
That beeing said, the solution is inside a git repository, and the other person working on this project has entered at a later stage with Visual Studio 2013 - But i dont know if this has anything to do with the issue.
Go to your configuration Manager and make sure build checkbox is selected for your project.
other thing you can try is:
Go to tools > Options>> A window will pop up> Under Project and Solutions > select Build and Run
Make sure Before building is set to Save all changes
So what seemed to happen was that there was some kind of dependency on a separate git repository (bootstrap), in our private repo that i hadnt been getting access too - so instead of giving me an error about it it just silently failed.
Adding access to the repository to my account, suddenly made the project run again.
Try this:
Go to Tools -> Options -> Projects and Solutions -> Web Package Management
Under that UNCHECK option "$(VSINSTALLDIR)\Web\External".
After UNCHECKING the "$(VSINSTALLDIR)\Web\External" option, Restart Visual Studio and try to rebuild project.
Check whether any NuGet packages are missing, that was the problem with me. Go to
Tools -> NuGet Package Manager -> Package Manager Console
If any packages are missing, Visual Studio will show you a message and a "Restore" button to fix the problem. After that the application should build.
I have a strange behavior with Visual Studio 2013 and .Net Compact Framework:
I can compile my WinCE program correctly, I can deploy it and start in debug mode by pressing F5. Everything is fine. But if I change my program and press F5 the application is compiled but not deployed, debugging starts with the old application.
(after than I can deploy the application and start it by hand, so I see it's compiled but not deployed)
If I start a new solution, add a new Visual C# project it all works correct. It worked in my working solution but not anymore. My working solution has a 'C# Class Library', 2 C# projects and 1 C++ project.
Hardware is a Toradex Ixora with Windows Embedded Compact 2013, VS 2013 Update 5.
Ah, a little embarrassing:
Right click on solution -> expand 'Configuration Properties' -> click 'Configuration'
There the checkmarks are missing for 'Deploy'
I'm using Visual Studio Community Edition 2013. When I select Run All in the Test Explorer, the latest changes I have done to the test code will not be included. I have to remember to right-click on my tests project and choose Build each time, and it is annoying.
How can I fix so that the build is always done automatically, like it is when running an ordinary project?
Solved it: for some reason the active solution configuration in the Configuration Manager (reached by right-clicking the solution in the Solution explorer) was set to not build all projects. I don't know how this came to be, but now it works at least.