LaunchSettings.json missing in VS2019 - visual-studio-2019

VS2019 web project 4.7.1 framework
Till Visual studio 2017, there was a file to store Environment variables "launchsettings.json"
using c# environment.GetEnvironmentVariable("Name of variable") we can read environment variable values,
Recently I created a new project in VS2019 and there is no file by default as "launchsettings.json" and when I added JSON file manually c# code is not able to read those environment variables
Does anybody know where to store environment variables in VS2019?

You have 2 ways to access the environment variable section.
You can add/change them through launchsettings.json.
Or you can right-click on the project and select Properties. Then you go under Debug tab and you will be able to change them.

Related

Adding project from VS2013 to AzureDevOps

Im using VS 2013 (CE).
Windows Server 2012 with a local install of Azure DevOps.
I can connect to the repository via the URL
http://example.local/DefaultCollection
Under defaultCollection i have another few test projects i.e.
/DefaultCollection/A-Project,
/DefaultCollection/B-Project.
For this example i will user C-Project which im trying to add to source control.
All im trying to do is add a project to this source control but i am experiencing issues that i would have thought shouldnt exist:
In VS2013, I add a new solution. I right click the project and select "Add solution to source control". Immediately it selects the project A-Project with the path /DefaultCollection/A-Project/C-Project. I dont want this as it resides inside another project.
From the web portal i create a new project and select Team Foundation Server (not Git as the examples online i have seen all select Git). In VS i create a brand new project and then attempt the same as 1 above but it tells me that i already have a project with this name under source control. I expand A-Project and i see it listed and undo any changes but it still doesnt add as i get some form of error.
Other problems range from the local version not mapped to, existing file exists/under source control to other errors.
What is the correct process to add a project to Azure Devops when using Visual Studio 2013 CE?
The default steps are described here: Set up Team Foundation Version Control on your dev machine.
You have to:
Create a workspace from the target project.
Copy your project into the locally mapped folder.
Add your project to the source control.
As workaround:
Create workspace from the target project: Create and work with workspaces
Copy your project into the locally mapped folder.
Add your project to the source control by: Manually add files to version control
Open the project and fix source control bindings:
Useful document: Add files to the server

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

JetBrains Rider: Can't change environment variable in a project profile

I am attempting to modify a .NET project's settings profile in JetBrains Rider on Linux by changing its environment variables. However, when I click on the folder icon, I can't click to add, delete, or modify any environment variables.
I noticed that in Rider's instructions on changing environment variables, they are not showing a folder icon, but instead a "..." icon which does allow you to edit environment variables.
My question is: How can I edit my environment variables?
Under your project folder, go to:
Properties -> lauchSettings.json
Then go ahead and edit your environmentVariables there

Release Management v12, how to deploy web.config transforms to different stage types

We have Release Management Update 2 installed and using TFS 2013 Update 2 continuous deployment build template for releasing a web site.
We have three stage types: Integration, Staging and Production.
What's the best way to release a web site when there are web.config transformations for each stage? Transforms are for connection string, appsettings and log4net.
I'm starting to lean toward this question's best answer, yet would like to know if I'm missing a tool or an easier path.
Release Management for Visual Studio 2013 has its own variable management system. When you configure a Component, you get to set what properties are used for it.
You can then use a single web.config file with "__myveriableName__" in place of the values. On the properties tab of the Component you can select what types of files the system will find and replace variable in. So here you would say *.config.
This way you can have just two configs configured... dev.config that you use for local development with local settings and a release.config with the variables defined that Release Management uses...
You can get information on how from Professional Application Lifecycle Management with Visual Studio 2013 or on the Visual Studio site.

Can we exclude Web Application's PublishProfies folder from project and source control in VS 2012?

With the new Visual Studio 2012 there is this so called directory "PublishProfies" which is located under the "Properties" folder.
Every time we create a publish profile for a web application, it is stored into that directory, then automatically added to the project and the source control (we are using TFS 2012). For our development environment this is not a desired behaviour. We would like each developer's machine to be able to have it's own publish profiles.
Is it possible to somehow tell the Visual Studio to store these profiles elsewhere, or at least not to add them to the project structure and source control respectfully?

Resources