"Build" builds my project, "Build Solution" doesn't - c#

I've just started using VS2010. I've got a largish solution that migrated successfully from VS2008. I've added a console application project called "Test" to the solution. Selecting build->build solution does not compile the new project. Selecting build->build Test does build the project. In the failure case, no error is given.
Similarly, setting this project as the startup project and pressing F5 to start debugging also fails to compile.
I'm upset by this. Can anyone calm me down by telling me what I'm doing wrong?
EDIT
I don't know if this is relevant or not, but today I installed AnhkSVN 2.1.8420 (latest version).

Make sure the solution configuration is set to build your new project.
Go to Build | Configuration Manager and see if the build checkbox is set for your project

For me it was incorrect build order. Right click on the solution and click on Project Build Order.... If anything is built in the wrong order switch to tab Dependencies and set correct values. After this everything worked for me.

Related

TFS Binding Invalid After Upgrading Project From VS2015 to VS2017

I began working on an .Net Core solution in VS 2015, which contains an ASP.Net Core project and a couple of .Net Core class libraries. The solution was under TFS source control.
I wanted to include some unit tests. Since .Net Core unit test project templates are not included with VS 2015, I decided to install VS 2017 and upgrade the solution. After upgrading, I was able to add a unit test project and everything compiles and runs normally.
When I first opened the solution after upgrading, though, I initially got an error about the solution being treated as though it was not under source control. Based on Google searches, I went into File -> Source Control -> Advanced -> Change Source Control and clicked "Bind" on each project. The three old projects link right up and show up as "Valid", while the solution file and the new unit test project show up as "Invalid". Unbinding, unloading, reloading, and rebinding the invalid project did not help. I can force the project to bind even though it is invalid (against Visual Studio's warnings), and after some tinkering, I can get the solution to check in, but when I get latest on another machine, the three original projects say "Not Available" and the unit test project is not visible.
Other symptoms: project.json is not found when I try to check in (I have to "undo" or "exclude" to check the solution in) and regardless of what I try, the invalid unit test project's folder shows up in the root folder of the directory tree (at the same level as "src" and "Backup") while the valid projects are in the "src" directory. I am inferring this is because the new solution types allow an .xproj file, while the old solutions required project.json, but I don't know what to do about it...
Any ideas on how to relink this to source control would be appreciated! I did not upgrade TFS server when I upgraded VS, but I don't directly have access to it, so hopefully this is not a requirement...
To fix the invalid binding in VS, you could try to follow below steps:
Click the “invalid” project in Solution Explorer.
Open “File | Source Control | Change Source Control”
Unbind the invalid project.
In Solution Explorer, Unload the project.
In Solution Explorer, Reload the project.
Also clear TFS and VS cache, delete the old workspace, create a new one, get all projects you need from TFS source control. Everything should be back on track.
Sledgehammer approach not normally needed, just Delete the contents from the following folder
C:\Users\<<Your Alias>>\AppData\Local\Microsoft\Team Foundation
Do not delete the rest unless necessary, fix the cause not the symptom.
My issue was that the project name had a period '.' in it. Removed it and the change source control Bind was Valid.
I tried all the solution above and none of them worked for me.
But I found a way to force add project. In Visual Studio :
Go to team explorer
Click on Home
Click on Source Control Explorer
Select the directory and click on "Add Items to Folder" (the icon is a file with a little green + in the top left corner)
Add your project files
... problem solved

How to run a project in Jetbrain's Rider IDE?

I've started to learn c# recently and I really like the Jetbrains IDEs, so I decided to pick up Rider in it's early developement phase. Since it's a brand new environment I could barely find any information about it at all.
My problem is I simply cannot run my project, I have Mono installed and I gave it's path to the IDE but it still sais "no projects to run".
Do I need something aside Mono? Or what would you recommend me to check?
Screenshot
I had the exact same problem and I think I figured it out (without having to recreate a project from scratch).
The list in front of "Project:" is empty when there is no runnable project.
A "Class library" for instance is not runnable.
Just pick up one of your solution's projects (in your case there is only one), right click, then "Properties", and in front of "Output type:" (where you should see "Class library"), simply select "Console application".
Now you should see it in the window appearing when you click on "Edit configurations".
Create a new project:
Write your code:
Press Ctrl + F5 and you should see this window:
Now simply click on Run. The next time you need to build it, you won't see the configuration settings, but it will still run the project. :)
It's solved in the comments, create Console App instead of empty solution, or if the problem already happened you should go to project properties and choose your language.
This happened to me just now, coming from a dotnet new angular generated project.
What I did to solve it was to right-click solution and then add existing project.

VS2015 The breakpoint will not currently be hit. No symbols have been loaded for this document

I have solution with 3 projects. Project one - Library. Project two - Service (asmx). Project three - Test. In my service I have two config transform: PRODUCTION and TEST. They are equals, but name of databases is different. My solution:
If I Debug Test with PRODUCTION.config then all right - my breakpoints is active. If I Debug Test with TEST.config then bad. I get this:
What could be the problem? Sorry for my English.
Fixing:
Right mouse click your project
Select Properties
Select the Build tab
Make sure Define DEBUG constant and Define TRACE constant are
checked
Click the Advanced button at the bottom of the Build tabpage
Make sure that Debug Info: is set to Full
Click OK and save changes
Clean solution and rebuild the project
Link to source Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.”.
(step 6 generates the .pdb files, these are the debugging symbols)
For more information see next screenshots. Build settings:
Advanced settings of build:
Checked for Microsoft Visual Studio Enterprise 2015 and Microsoft Visual Studio Professional 2017.
I had similar issue and I did the following simply:
Go to Debug => Options => General => Remove the check mark for "Enable Just My Code"
This worked for me.
Another reason this can happen is that if you are sharing multiple projects between solutions and you have set up custom build configurations then simply changing from release to debug on the toolbar (or other shortcuts) can mess up the active build configuration and create all sorts of random consequences.
Make sure that Solution > Properties > Active Config is what you expect ('Mixed' is usually bad) and use Solution > Configuration Manager if in doubt.
I forgot again and the tactics popular on the intertubes did not, of course, work so this is partly a note to self...
Require source files to exactly match the original version
This has to be unchecked.
As a future reference, the same issue can happen when you have the same assembly both in GAC and bin\Debug folder. Just deleting the assembly from the GAC and it works again.
If you're doing multiple startup projects, make sure you have all your services your want to debug set to Start
First try rebuilding your project by right mouse click the project > Rebuild If that doesn't work, try a clean of the project (right mouse click on the project > clean)
I had similar issue and I did the following:
Debug=>Options=>General => Remove the check mark for "Enable Just My Code"
This worked for my vs
Try adding or updating your .csproj file with the tag <DebugType>full</DebugType> inside <PropertyGroup>. This solved my problem.
I am using a solution with several projects (Visual Studio 2015).
In my case, the problem was solved when I realized that one of the projects was being defined with another URL in: Project properties - Web - Servers - Project Url.
After changing to use the same URL as the other projects, the problem was solved.
Image
I am using a solution with several projects (Visual Studio 2015).
I tried several approach. This one worked for me.
In my case, the problem was solved when I realized that one of the projects was being defined with another URL in: Project properties - Web - Servers - Project Url.
After changing to use the same URL as the other projects, the problem was solved.
Image
In my case the project under which the debug breakpoints were not getting hit was also referenced by another solution which was at the time running.
When I stopped that solution the breakpoints started hitting.
If the library happens to be c++ with a C# consumer project actually doing the calling into it, you need to go to Properties -> Enable Native Debugging in the consumer project, and make sure this box is checked.
This can happen if you haven't set the current project as the startup project. In the solution explorer navigate to your project right click and select set as startup project.

How to use NUnit 3 in VS2015RC

Is it possible to use NUnit3 Beta in VS2015RC?
I've just created a new Library Project (Package) and added NUnit and created a simple test to show the errors I'm getting.
Does it have some dependency on an older version of the framework?
project.json
Test Class
Update
The Release Notes say:
To work around this issue, follow these steps: Right-click the project
in which the errors are reported in Solution Explorer, and then click
Unload Project. Right-click again on the project in Solution Explorer,
and then click Edit .
Note In this command, represents the actual project
name. In the entry at the top of the project file that
has no Condition attribute, add the following:
true
Save and close the file. Right-click the project name in Solution
Explorer, and then click Reload Project.
However I cannot get this to work, I just get more warnings and errors in my errors window.
It is very likely that you should use xUnit.net for now,
https://github.com/aspnet/Testing/issues/34
NUnit won't be ported unless someone steps in.

Visual Studio 2012 not building dependent projects

I just upgraded a VS2010 project to VS2012 and am now having a problem where dependent projects are not building on demand. For instance, say I have the following projects in my solution:
Library A
ConsoleApp 1
Where ConsoleApp 1 references Library A. If I change the signature of a method in a class in Library A and run ConsoleApp 1, there will be a compiler error due to ConsoleApp 1 not seeing my changes because running ConsoleApp 1 did NOT cause Library A to build.
If I manually build Library A, then manually build ConsoleApp 1, it works fine. However, I would expect that running ConsoleApp 1 should cause any dependent projects to be rebuilt before launching.
Could I have something configured incorrectly? Or is this a bug in VS2012?
Your symptoms sound very similar to those I experienced a while ago. Ensure that the projects are set to build with your current active solution configuration and active solution platform under Build->Configuration Manager.
Try by removing project references and adding them again (path to follow: References -> (right click) Add reference -> Solution -> Project). Before giving another try Save All. This is how I solved it.
This happens when the .suo file for the solution becomes locked and Visual Studio is no longer able to write to it. Another symptom of this problem is that you will see temp suo files being created next to the solution when you open it. Try closing Visual Studio and deleting all *.suo files in your working area. Then reopen Visual Studio and rebuild all. No need to manually rebuild your solution. This will fix the issue when it is caused by a locked .suo, as happened to a colleague of mine today.
In his case, the cause seemed to be that he shutdown his laptop while Visual Studio was still open. Maybe the shutdown of Windows didn't complete cleanly? We can only speculate on how the .suo originally became locked.
I tried all the solutions above and that did not fix the issue for me. I found that it was because of the Active configuration in the ConfigurationManager was set to build only the Main (start up) project.
Go to Build > ConfigurationManager
Ensure that all the projects you want to build are checked as in the screenshot below
This is a similar issue on Asp.Net forum here and this is the details on MSDN
. Although it was weired, bcoz I never changed these settings and it was working properly last week
I've encountered a similar problem, the solution (or the probelem) were the Build and Run settings under Tools > Options... > Projects and Solutions > Build and Run where "Only build startup projects and dependencies on Run" was checked. The screenshot shows my currently working solution.
For me, I resolve the issue by right clicking on the project; Build Dependencies > Project Dependencies. Then manually setting the order for each project. very painful if you have a lot of projects.
make sure that the referencing project has same or higher .Net framework version than the referenced project.
Right Click solution in solution explorer then click "Clean Solution".

Categories