Is there a Visual Studio 2019 way to combine solutions? - visual-studio-2019

It used to be that when I would go to the open project/solution dialog, I would get:
But now in VS 2019, these options are gone. How do I perform this same task in 2019 (dump all the projects from one solution into the other)?

I was just about to post my question when I had an idea, and it turns out to be the answer:
In the Solution Explorer, right-click on the currently-open solution (the one you want to dump projects into).
Add->Existing project:
Change the file type/extension drop-down to Solution Files (*.sln).
Select the solution to import projects from and import away!

Related

Adding Javascript file to MVC Project in VS 2022

I have migrated my project from VS 2017 to VS 2022,
And I have a strange problem:
When attempting to add a new .JS file to the scripts folder
I don't have the option to select .JS file in the "Add New Item" menu (via right-click on scripts folder), only .TS or .JSON:
Tried "playing" with it and searching but did not find any solution.
can someone please tell me what am I missing?
This depends on one thing that is if you installed all required modules for Visual Studio 2022.
The basic thing here is to Right-Click on any directory/folder in the Solution Explorer window, Select Add and then New Item. You then click on the Language you are programming in. Note: if you don't click this folder, the options you may see would be only for the selected folder.
See below images...

VS 2019 - How to choose location for Add new project

For a VS 2017 solution, when you right click on solution and choose add new project, in the templates page there is an option to choose the destination folder (if different from the solution folder), however it does not seem to be an option in VS 2019 preview. Is there anyway to have that option show up ? (is it even an option in 2019 ?)
To clarify - this is when you already have a solution open and are trying to add a new project to that solution
Apparently, it was an issue with Resharper as well which messed up the new project dialog windows. Once that patch was installed everything worked as expected throughout. Odd issue and an even more odd fix.
https://youtrack.jetbrains.com/issue/RSRP-473453
I have VS2019 preview installed.
From the start page select 'Create a new project', then select a project type. For example 'Class Library (.net Core)and press the next button. The next screen will present you with textboxes forProject name,location,solution name` and an option to place the solution and project in the same directory

Visual Studio 2017 - Publish Individual File Missing from Menu

Currently working on an MVC project, I used to be able to right click individual files such as js files, and choose publish, so I wouldn't have to publish the entire project for changes in a single file. After installing updates the other day, I no longer have that option from the solution explorer menu when I right click a file.
Has this option moved locations? Is there a setting I need to configure first? Thanks!
Sounds crazy, but install microsoft azure tool in visual studio 2017 tool list . I am not able to sure why microsoft did so

TFS from Solution A showing pending changes from Solution B - using team foundation services

I'm using Team Foundation Services to manage two different solutions. They're both in DefaultCollection. If I open up Solution A in visual studio and make a change, Solution B shows this pending change in Team Explorer. Is this intended behavior? Can I change this so that the instance of VS with Solution B doesn't see anything from Solution A? It's concerning because I'm worried that files from SA are getting added to SB.
Welcome to the world of TFS Workspaces. The files in Solution A are not actually being added to Solution B but in Visual Studio what you are seeing is a list of all the files that are currently checked out in that TFS Workspace on your machine. This behaviour is by design (and actually can be very helpful if you happen to edit some files outside of Visual Studio).
Jesse has an excellent write up on how to separate out these things if you want to. Basically you can define a separate TFS workspace for each solution.
<shameless_plug>For more information on TFS workspaces you might also want to check out the Professional Team Foundation Server 2012 book.</shameless_plug>

How can I completely remove TFS Bindings

I have a solution that contains a good deal of projects,
I would like to remove the source control bindings completely, how can I do this?
Update:
What I really want to do is move one solution and its projects from TFS 2005 -> 2008. Thats why I am removing the bindings, is there a better way to do this?
File -> Source Control -> Advanced -> Change Source Control and then unbind and/or disconnect all projects and the solution.
This should remove all bindings from the solution and project files. (After this you can switch the SCC provider in Tools -> Options -> Source Control -> Plug-in Selection).
The SCC specification prescribes that all SCC providers should implement this behavior. (I only tested it for VSS, TFS and AnkhSVN)
I have no File -> Source Control menu in Visual Studio because I've never used TFS with this installation of Visual Studio.
My problem was I was opening a solution from the internet and the original author had forgotten to remove the TFS bindings, so every time I open the solution I'd get an annoying popup saying
"Go Offline
The Team Foundation Server http://some-other-guys-tfs-server/
is currently unavailable.
The solution will be opened offline."
To get rid of this, I deleted the .suo next to the .sln file, and then opened the .sln file in Notepad and deleted this entire section:
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {xxxxx}
SccTeamFoundationServer = http://some-other-guys-tfs-server/
SccLocalPath0 = .
SccProjectUniqueName1 = xxDemo\\xxDemo.csproj
SccProjectName1 = xxDemo
SccLocalPath1 = xxDemo
EndGlobalSection
Save the .sln in Notepad and then open in Visual Studio, problem solved.
Update: Saveen Reddy has created a tool to do this. I haven't tried it though.
The simplest solution would be to open Visual Studio, deactivate the TFS Plugin in Tools > Options > Source control and reopen the solution you want to clean. Visual Studio will ask to remove source controls bindings
If anyone needs to do this outside the context of the Visual Studio application - via command-line for example, I wrote a small tool which will strip the source control bindings from Solution And Project files. The source is available here: https://github.com/saveenr/VS_unbind_source_control
Next works for me:
Delete all .vssscc (solution binding) and .vspscc (project binding) files
Remove block GlobalSection(TeamFoundationVersionControl) = preSolution from solution file
There could be also information regarding source control in the proj file in tags
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
SAK states for "Should Already Know", so it can be kept.
Old post, so just adding to the answers of #Matt Frear and #Johan Buret. Both work.
But in Matt's case, you also need to set these (VS 2012) in Notepad/text editor:
SccProjectName = ""
SccAuxPath = ""
SccLocalPath = ""
SccProvider = ""
To each project in the solution file (.sln).
#Johan's answer effectively does this....
Sometime, the binding info is cached
To clear Team Explorer's cache:
Go to C:\Users\<user>\AppData\Local\Microsoft\Team Foundation\2.0
Delete or rename the Cache folder.
This come from a website I could not find now. Thanks for that guy for the tip.
You could try using this tool which automatically removes the Team Foundation Bindings from a project.
http://www.softpedia.com/get/Programming/Other-Programming-Files/Team-Foundation-Binding-Remover.shtml
I found this tool that helped me get rid of a tfs binding complitly its found here
https://marketplace.visualstudio.com/items?itemName=RonJacobs.CleanProject-CleansVisualStudioSolutionsForUploadi
it creates a zip with the removed source binding without modifying the orginal project.
In visual studio 2015,
Unbind the solution and project by File->Source Control->Advanced->Change Source Control
Remove the cache in C:\Users\<user>\AppData\Local\Microsoft\Team Foundation\6.0
In VS2017
go to Home in Team Explorer
Click on Settings in project section
Click on Repository Settings in Git section
From next window see Remotes section. you will see option for remove
NB: I check that for git repository
The other option is
Delete the workspace
re-map when needed
Make sure to check, rollback (Undo Pending changes)
before you remove workspace
This is quickest and surest one
Good Luck
Go to File -> Source Control -> Advanced -> Change Source Control (if change source control doesn't appear, click on solution in the solution explorer then try again)
Unbind solution and all projects
Now right click on solution and you will see "Add Project To Source Control". if you want to add project to source control again you might be get some errors that ask you to change the solution folder on TFS. it happens because your solution has some mapping in a workspace yet. remove mapping or delete workspace. now your solution is completely unbind and unmapped from TFS or workspaces.
Here you can find another tool (including source code) to remove both SCC footprint from the solution and project files and the .vssscc and .vspscc files. In addition, it removes the output and other configurable directories.
Hth
Stefan

Resources