Missing 'Manage User Secrets' context menu item on Visual Studio for Mac - visual-studio-mac

I've been told to manage user secrets on a .net core project, however the context menu item for this seems to be missing in visual studio for Mac? Is it in a different place to windows? Or is there something additional to install etc?
Note: It also didn't add the XML line for the user secret id in the project file either when I opened the project - not sure if that's relevant?

Turns out (for anyone having the same issue), that on Mac the user secrets have to be created manually in ~/.microsoft/usersecrets/{usersecretid}/secrets.json as the user secret functionality is missing from Visual Studio for Mac.
Worth noting that this is a hidden folder and if it doesn't exist you can create it and that will work. You can show hidden files / folders on mac using CMD + SHIFT + .

Related

Delete visual studio 2019 extension settings

Don't suppose anyone knows how to find and delete settings for an extension in VS 2019. I uninstalled one and reinstalled and it was already populated with its previous settings. Its seems surprisingly difficult to pinpoint for some reason.
Just to add to this, I have found out that extensions utilise an options page. Now just to work out where Visual Studio stores all the data entered in an options page.
UPDATE
With help from Sergey I have located the settings. They are present in %localappdata%\Microsoft\VisualStudio\"Current version"\privateregistry.bin
To access the keys you need to load the file in regedit(as admin). Then click HKEY_LOCAL_MACHINE and File -> Load Hive and navigate to the bin file and type the name of the Key you want it to load as e.g "VSSettings". Then you can navigate HKEY_LOCAL_MACHINE\"VSSettings" to find settings.
Don't forgot to unload HIVE after as you won't be able to open Visual studio without unloading it first.

How to get changes from other users in VS Code from TFS

This question is for building Angular application in VS Code.
My team has been coding in VS2015 and using Microsoft TFS for version control (Please note that our code is within the company firewall, on a local TFS build server and not on Gits repository). For Angular, I installed VS Code and Azure Repos plugin for TFS.
Once Work-space is setup, I can see the files (I downloaded the files from VS2015 on local machine) but they all show as "Untracked" changes - why? These are checked in files.
Also, when a colleague checks-in files from their VS Code instance, my VS Code doesn't get it.
What is that I am missing here?
I figured out the issue (or a workaround). Posting my solution for any newbie facing the same issue:
Please note that my code is not in GITS or any remote repository, it is in Team Server hosted in the company data center.
I have a workspace created in VS2015 via which I mapped my Angular code and downloaded it on local machine.
VS Code Settings:
Make sure you have Azure Repos extension installed.
Go to File->Preferences->Settings (make sure User settings tab is selected)-> Extensions-> Azure Repos extension:
Provide the values for following fields:
(a) Tfvc: Location Example value for VS2015: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\tf.exe
(b) Tfvc: Proxy
Example (this should be your team server name): https://dataCenter.myCompany.com:9100/tfs
(c) Tfvc: Restrict Workspace (this is optional, use only if needed)
Check the box
Goto View->Command Palette-> type Team: Signin, provide username and password.
Goto File->Open folder-> select the folder mapped via VS2015.
Once the folder is open, you will see all files inside the folder. Go to File->Save Workspace As and give it a name.
Now you should be able to see any changes done by you in either VS2015 or VS code. Check-in should reflect the changes for you and other users connected to the code.
Previous Mistake: I realized that I was using Gits:Initialize Repository (as advised on various sites) which was causing all the trouble of "Untracked" changes and other users' changes not reflecting in my code.
Thanks,
RDV

When publishing my ASP.NET Core MVC App, the Entity Framework Migrations option shows an error

I'm on Visual Studio 2019 v16.4.3. I tried publishing my ASP.NET Core MVC web app to Azure and followed the steps shown here:
Publish an ASP.NET Core app to Azure with Visual Studio Code
But I'm stuck at this part of the tutorial:
I tried running both these commands:
dotnet tool install dotnet-ef
and
dotnet tool install dotnet-ef --version 3.1.1
but I'm given the same error as the one in the image: "Tool 'dotnet-ef' failed to install."
I already have a local sql db filled with data but it's not sent to the Azure SQL Database that was setup. The database context and tables weren't created on the Azure SQL Database either. How do I get my database with all its data synced and published to the Azure SQL Database? Thanks!
So I've finally found the answer with the help of this answer: https://stackoverflow.com/a/58926602/5874473
First, go to Tools > Options > Environment > Preview Features, then check the option: Use previews of the .NET Core SDK (requires restart)
Afterwards, close Visual Studio and make sure that MSBuildSDKsPath has the correct folder path. To do that, open the Start menu, search "environment variables", then click Edit the system environment variables.
On the new window that popped up, click Environment Variables... on the bottom right. Then in the System variables table (the lower half), look for MSBuildSDKsPath and make sure that it points to a 3.x sdk.
If not, edit it, click Browse Directory, then go to C:\Program Files\dotnet\sdk and open the 3.x folder. For mine, it was 3.1.101. After opening it, select the Sdks folder then click on the three OK buttons to save the changes.
Afterwards, open Visual Studio 2019 again. In the Package Manager Console, type:
dotnet tool install dotnet-ef
and it should work now.
Afterwards, make sure to check the checkbox under Entity Framework Migrations. To do that, right-click on the solution then click Publish. Then near the top, under the Web Deploy name, there are 4 buttons/links (New, Edit, Rename, Delete). Click Edit, then click Settings, then the Entity Framework Migrations, then check that box. Don't forget to check the box under Databases too, if you haven't done so already. Then click Save, then click Publish on the top right!

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

What is the path when using Team Foundation Version Control (TFVC) as the VCS for a Jenkins project?

I'm trying to connect a Jenkins project to a Visual Studio Team Services repository.
If I use the "Git" option for the VCS in the configurations (as I've seen in most tutorials), I get authentication issues, and entering my credentials does not remedy the error. If I use the "Team Foundation Version Control" option, it accepts the repository URL without any errors, but it asks me for the "project path."
So, my question is actually twofold:
(1) Since Team Foundation is now known as Visual Studio Team Services, is this option depreciated and thus not worth using in my configuration anyway? I haven't even seen it or heard it mentioned as an option in any tutorial I've gone through, so I'm not sure if it's even used anymore (I thought my version of Jenkins was current, but I guess it might not be, somehow.) If this option is outdated, what is the preferred method now?
(2) What is the "project path" that it is asking for? It says it must start with $/, so I'm not sure if that means it's the path to the project in the file system of the environment it's going to be running in (in my case, on a slave machine), or if it's referring to its path in the Visual Studio Team Services system or what exactly.
I've attached a screenshot below for reference. Any and all advice will be appreciated.
Jenkins VCS config screenshot
Regarding git authentication issue, you can use Personal Access Token (username can be anything, such as test) or Alternate Authentication Credentials. The same as TFVC.
Regarding the path, it is the server path of TFVC
Go to Code page of team project
Select Files tab
Select a folder
Get the path

Resources