TestDriven.net, right click, run test, doesn't re-build - c#

I am using testDriven.net and when I right-click and run tests, it appears to build, then runs the test. Only it doesn't really do the build. I keep making changes and the test still fails:) I have to do a VS Build, then run the testDriven.net to get changes to take effect.
This clears up for a while if I delete the solution's .SUO file. Any thoughts?

You already provided the workaround in your answer, which is to build first, then run your tests.
Is your version current?
Release Notes - TestDriven.NET: 2.14
1390: Honour the solution 'Configuration Manager' project 'Build' settings
When running all tests in a solution, only projects with 'Build' checked in the 'Configuration Manager' will be built and executed.
Release Notes - TestDriven.NET: 2.12
1199: Improve support for "Smart Build"
This version should correctly determine when a build is required before a test run. The previous version might incorrectly skip the build if only a non-source project item had changed.

If your only change is to a configuration file (or some other resource that's copied to the output directory conditionally, not a code file) then Visual Studio might skip the compile step. A clean/rebuild will fix this.
To diagnose this kind of problem, try turning up the verbosity of the MSBuild output in the Visual Studio environment. Choose Tools | Options, Projects and Solutions root item, then the Build and Run page. The default for the MSBuild project build verbosity is "Minimal" which is terse but sometimes not enough.

Related

Visual Studio C# debugger - the breakpoint will not currently be hit

I know that this question has been asked several times, and many people here have suggested different answers. Though none of them are working for me.
I created a Windows Forms application with Visual Studio and .NET framework 4.0 and added a breakpoint. However, when I debug the application, an exclamation mark appears on the breakpoint and it says..
The breakpoint will not currently be hit. No executable code is associated with this line. Possible causes include: conditional compilation or compiler optimizations.
I have tried out several suggested solutions
Cleaned the project
Deleted the pdb
Checked the configuration and ensured that it is debug
Set the debug configuration from "x86" to "Any CPU"
Tried creating project from scratch
Tried re-installing .NET framework
Removed temporary ASP.NET files
However, none of them seems to be working. I was able to debug my projects with breakpoints before and for some reason, something happened and I am not able to debug the projects any more. What should I look out for or fix to resolve this issue?
Probably your breakpoint is in a project which is not dependent on the "startup project". Implicitly these projects are not compiled on Run (button F5).
Go to: menu Tools → Options → Project and Solutions → Build and Run → uncheck first check box (only build startup projects and dependencies on Run).
I recently had this problem and it stumped me for a while. Ends up I had inadvertently switched my build configuration away from DEBUG to another configuration that was more optimized and did not "Define DEBUG constant": Project > Properties > Build > (first check box).
This may also happen if other projects in your solution are set to configurations other than DEBUG, usually accidentally, in the Solution Configuration Manager.
In Visual Studio go to the menubar, menu Debug → Windows → Modules, find the assembly your code is located in and check the Symbol state. Chances are you're having Visual Studio loading a different version not matching your PDB files.
I had the same problem here...
I was using Visual Studio 2005 - Professional Edition, and my problem was when I tried to breakpoint a Windows Forms application.
I've searched in many forums on the Internet, and I hadn't found any answer.
But the solution for this problem was easier than I had expected. Just right click on a Visual Studio shortcut (or .exe) and unmark execute in compatibility mode.
Your best option is to create a new project. Then import all the files in the previous project, including your forms if any.
You are now set to OK to continue.

Visual studio 2010 IDE build fails mysteriously with no errors or warnings

If I try to build my .sln file in visual studio (using release configuration, but actually none of my configurations build), the build fails with zero errors in the output window and none the error list. In fact, in the build output window, I have 7 projects listed. And under normal verbosity, I have 7 "Build succeeded." lines after each project. Yet at the bottom:
========== Build: 6 succeeded or up-to-date, 1 failed, 0 skipped ==========
By building the projects one by one, I have found the 'failing' project and I tried to build it all by itself. It depends on one other project and that builds just fine all by itself. I try building the 'failing' project by itself and I get zero errors and no warnings and a build failed. However in the 'bin' folder for that project, (if I delete the old bin file) I am getting a built dll. Doesn't do me much good though, since the build is 'failing', visual studio makes no effort to launch my project in debug mode.
Here's something puzzling: In the command line, I have navigated to the directory with my .sln file in it, and I then run this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /ToolsVersion:4.0 /p:Configuration=Release
Then, in bin/Release, voila, I have my built project. The build passes in the command line but not the IDE.
Does anyone have any suggestions? This problem has happened to me twice: Once on windows server 2008 and once on windows xp sp3.
Visual Studio 2010 says Build failed with no errors after I change a source file
One answer there suggested that I change the place from where I'm building. Here's the path of the debug directory:
C:\Users\Isaac\Documents\Visual Studio 2010\Projects\checkout\Library Projects\BaseSystemCore\BaseSystemCore\bin\Debug
Just moving the checkout directory to c:\ did the trick. Something to do with the build path being too long.
I had the same error, it would not build but no errors. Restarting visual studio worked for me, this was in visual studio 2012.
Close Visual Studio. Run cmd, and type: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
/ToolsVersion:4.0 /p:Configuration=Release yoursolution.sln
Then, enter again on VS and run your project. Worked for me!
if your solution contains too many projects ,
build projects individually,
Check which project is failing
for that project check the references of that project , if on any reference if their is yellow color mark, then delete that reference , and add that again , then build and check,
this will work
or
check in output window , each line , in some line it may be showing , dependency is their, but file didnt exist
that is the problem causing
this may be due to file corruption

Automated Build script in VS 2008

I have built an installer using WiX that consists of multiple .exe files that are 'Release' builds of other .Net projects (VS 2008). Each time I update one of the projects, I build that project and copy the Release build into the installer and then build and release the installer.
I find it a very tedious job to constantly check if the exe's that the installer has are the latest version or not. Is there a way that I can automate this build process so that as soon as I build the installer, it will generate the latest release builds of the associated projects and place the .exe file in the installer project.
I am new to VS and WiX, please advise. Thanks in advance.
You should be able to create a Solution containing:
- all projects which build the EXEs
- the installer project which builds your installer
Once you are there, you should be able to right click on the Installer Project and set dependencies to all the projects which create your EXEs. You should be able to build your Solution with the right EXEs bundled in your Installer.
Arun's solution is great idea, and I recommend it.
We also have a lot of assemblies that we maintain, and rather than copying them around we use symbolic links to minimize the number of build-and-copy actions. You can research mklink (http://en.wikipedia.org/wiki/NTFS_symbolic_link) for details.
We use it like this, but we do this as part of our environment setup, and not part of our build script.
mklink /project1/bin/project1.dll /project2/bin/project1.dll
This ensures for us that project2's reference to project1 is always up-to-date, whenever project1 is build, without needing to copy the file. In our case, project2 and project1 are not part of the same solution, and they have no direct references to one another (we do a lot of plugin-type reflection/assembly loading).
Hope this helps.

Visual Studio Build Avoidance when building many C# projects

I have a solution with a lot of C# projects. The dependencies are not cyclic and when I build a high level DLL it appears to be rebuilding all the project referenced DLLs that it is linked to before running the program.
This seems to be unneccessary because I did not change the code in those DLLs and they are at a lower level so the changes I made in the top level DLL should in no way effect the low level DLLs.
How can I tell visual studio to only build DLLs that depend up the hierarchy chain not both ways.
Go to Tools->Customize
A dialog will open. Go to Commands tab. In menu barradio select Build | Project only. Assign a shortcut to it and use it.
When visual studio checks dependencies, it runs the build process. This is not necessarily building your project. In Visual Studio, if you navigate to Tools->Options...->Projects and Solutions->Build and Run you will see a drop downs labeled MSBuild project build output verbosity. If you change this to Detailed. When you build, you will see, in the output window, that it is verifying whether or not files have changed in order to determine if it should rebuild the project. This is why it appears to be building every time.
You should use the following setting:
"Only build startup projects and dependencies on Run" under Tools / Options / Projects and Solutions / Build and Run.

VS 2010 Debugging old build

I have a visual studio 2010 web project that when I publish it in debug mode the application works fine and is the latest build.
However, when I try to click the play button/debug mode (in the same build configuration as what I published in) the assembly version is older than the most current one. As mentioned, this is a asp.net application using a c# class library as a reference (also in the solution) and I am debugging using Visual Studio's built-in web server.
I've tried everything I could think of at first in all different combinations as follows:
Clean solution
Clean each individual project
Build solution
Build each individual project
Rebuild solution
Rebuild each individual project
I tried to use a different browser and cleaned my cache as well.
Has this happened to anyone? How can I correct this issue?
It is most likely not set to build. To test this, try build then debug and see if things work. If so, then it is definitely not set to build.
To solve this, open up the Solution Properties. Go to Configuration Properties >> Configuration. Then run down to the project in question and check the Build checkbox. You will then be able to debug again.
This one bit me when a coworker decided the build of the UI was taking too long for his testing and removed it from the build. After discovering the issue, I had him create a separate solution to test in isolation. Yes, multiple solutions can contain the same project(s).
did you try deleting your bin and obj folders and removing your assemblies from the GAC? I would guess that THIS is the problem.
Don't forget to clean your Temporary ASP.Net (c:\WINDOWS\Microsoft.NET\Framework[version]\Temporary ASP.NET Files) files.
After that, do a rebuild and try.
Also, for local development, if you can, then do not GAC assemblies. GAC them while deploying to integration environment. THis will help speed up development a bit.

Categories

Resources