VS 2019 - How to choose location for Add new project - visual-studio-2019

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

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...

All the project files showing as Miscellaneous Files. Visual Studio 2017

I moved my Asp.net-mvc project from desktop to F drive and all the files are showing as miscellaneous files.
I've tried running the visual studio installer and modify to make sure that "Nuget targets and build tasks" are ticked.
I've also tried :
excluding the file
add existing member(adding the file again)
but nothing's working.
Same thing happened with my asp.net core web api when I moved it, it's working fine tho, getting data from server.
Hope you will solve your problem
Solution 1:
Create new project then paste all project contents in new created project.Restore Nuget packages then Build it.
Solution 2 :
Go to the file which are Miscellaneous inside Solution Explorer.
Right click those file'(s) and select Exclude from project.
Add Existing Item to project, you just excluded.
Probably your file property configuration is wrong.
Try this:
Right click over the File that has this problem
Click on Properties
Under Advanced -> Build Action, check if other than "Compile" is selected.
If so, change it to "Compile".
Properties Window

Is it possible to run a project from a solution in VS 2017 without it being assigned as the start project?

I have a MVC 5 solution in VS 2017 with 2 projects. Sometimes, when I'm working in one, I need to enter new information in the database using the other one. The only way I know of doing this is to stop debugging, assign the other project as the startup, run it, enter the info and then reverse the process again. Is there a way that I can access the project (which is light, not too complex) without stopping the current assigned startup project ?
Yes. Right click on the project and select Debug > Start New Instance from the menu
If you right click on the solution name in the solution explorer, there's an option for Set Startup Projects. You can then select what you want to start when you run the application.
It's also under the Project menu.

specflow generate step definitions missing from context menu

I followed the getting started instructions and the "generate step definitions" is missing from context menu.
I tried adding the additional specflow packages from nuget for mstest and still nothing.
I had the same problem. I was looking for this option in contextual menu of the feature file, but this option exists in the contextual menu of the content of the feature file. So, try open the feature file (*.feature) in the Visual Studio text editor and click right button of the mouse inside text editor. Example of the file:
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I press add
Then the result should be 120 on the screen
Assuming you are bringing up the correct context menu by right clicking in the .feature file as opposed to anywhere else then you may find that the issue is actually caused by the TechTalk.SpecFlow.dll not being referenced in your project.
To add the reference manually (NuGet didn't do it for me) right-click on the References folder of your project and find the TechTalk.SpecFlow.dll which will likely be in '[project]/packages/SpecFlow.X.X.X/lib/netXX/' (X's are version numbers).
Here is the context menu when I don't have the correct reference in place:
And here it is once I do:
This was SpecFlow.2.1.0 and VS2010 which led me to another issue with incompatible .Net versions so I ended up using SpecFlow.1.9.0.
Try to install SpecRun.SpecFlow from the Nuget Packages, after installation completes you'll get the "Generate Step Definitions" on the context menu.
It worked for me.
Install specflow from Extensions and updates and then restart the visual studio, clean and rebuild the solution
I had the same problem. maybe it was related with fresh IDE installation or maybe it was something new... here is just short note about this issue and possible solution:
At the beginning of IDE/project configuration check or install packages for SpecFlow in the NuGet manager.
Check twice what exactly you will use in the project Xunit or Nunit and then install the related package Xunit or Nunit. In my case, I was working with Xunit and install it.
After installation, you will see new items in the References
and pop about re-generation feature files
After that Generation steps will be available
This is because you may not have the simply installing the Extension for SpecFlow at Solution level is not enough.
SpecRun.SpecFlow is an evaluation version unless you are prepared to play for a license key.
I added the NuGet package SpecFlow.xUnit to the Unit test Project within my solution where I held my feature files. This resolved the issue, I now see Generate step definitions.
This is achieved by Right-clicking on your feature file in the code editor and select Generate Step Definitions from the popup menu. A dialogue is then displayed.
This happened to me when I migrated an existing project to a new PC.
Turns out I need to do: Visual Studio 2019 > Extensions > Manage Extensions > select 'Online' in the left hand nav > then search for 'Specflow' in the search box > then download it and close Visual Studio. It auto installs then.
Finally reopen VS and it should work.
In Visual studio 2022 the context menu item "generate step definitions" renamed to "Define steps" as per below specflow documentation.
https://docs.specflow.org/projects/specflow/en/latest/visualstudio/Generating-Skeleton-Code.html

Any way to just view conflicts in Visual Studio 2012

Is it possible to just view conflicts in Visual Studio 2012, without merging or checking in. In 2012 you used to be able to Get Latest Version then go to the pending view and click the show conflicts icon.
I'm keen know if you can do this without any add-ons / external commands, i.e. just using what Visual Studio 2012 standard installation has, without for example either of the following:
Team pilgrim:
http://visualstudiogallery.msdn.microsoft.com/79e9baa7-ea8b-4335-86ba-ae929bf67222
Or:
tf checkin
I was just searching for an answer to this myself, when I found out how you can do this. Here is how to can just view conflicts.
Go to the Team Explorer and select Pending changes. In the Pending changes window there is a dropdown menu named Actions, click that menu and in the menu is an option Resolve conflicts.
Click that option and a window will be opened showing all conflicts in the workspace similar to the resolve conflicts window of VS2010.
Hope it helps.
Use the "Compare To" option in the right click menu. You can choose to generate a diff between any two versions.
Alternatively, you can do basically the same option with 2012. You can get latest, which will throw any conflicts that exist between the local version and the server version. Conflicts can then be resolved locally, and then either discarded or checked in.
To remove automatic conflict resolution:
`Ctrl+Q --> "Conflict" --> ENTER --> Uncheck "Attempt to automatically resolve conflicts when they are generated"

Resources