visual-studio-2019

Does .Net Core support User Secrets per environment?

我怕爱的太早我们不能终老 提交于 2021-02-20 19:08:27
问题 Let's say I have connection string for Development environment specified in appsettings.Development.json and connection string for the Staging environment specified in appsettings.Staging.json All I need to do to switch between Development and Staging is to navigate to Visual Studio Debug tab in project properties and change the value for ASPNETCORE_ENVIRONMENT environment variable. Now, of course I don't want to have connection string in appsettings.*.json for security reasons. So I move it

Disable being able to edit code while debugging

我与影子孤独终老i 提交于 2021-02-18 23:35:34
问题 Recently when I've been debugging my application, I've been able to write code into C# files when the application isn't in the broken state. I've tried totally disabling the "Edit and Continue" setting in the visual studio options but that doesn't seem to be working. What I'm expecting to happen is when I'm debugging and I type into a C# file, I want that popup that says "Changes are not allowed while the application is running" prompting me to put a breakpoint in my code to apply changes

Visual studio 2017 / 2019 add areas missing

佐手、 提交于 2021-02-18 05:01:05
问题 While creating a ASP.NET MVC Core Web app using VS2017 / 2019, came across that 'Add Areas' option is missing from Context menu. 回答1: Area is not removed from VS 2017/19 but it is moved in Scaffolding and you can access the area using below steps: 1) Right click on your project and click on Add>New Scaffolded Item 2) After click choose the MVC area from the Menu: 3) After choosing give it Name, and after this the Area will be added to your project: Hope it will helps. 回答2: I had a same

Visual studio 2017 / 2019 add areas missing

寵の児 提交于 2021-02-18 05:01:01
问题 While creating a ASP.NET MVC Core Web app using VS2017 / 2019, came across that 'Add Areas' option is missing from Context menu. 回答1: Area is not removed from VS 2017/19 but it is moved in Scaffolding and you can access the area using below steps: 1) Right click on your project and click on Add>New Scaffolded Item 2) After click choose the MVC area from the Menu: 3) After choosing give it Name, and after this the Area will be added to your project: Hope it will helps. 回答2: I had a same

How to configure startup.cs based on solution configuration and not environment variable?

故事扮演 提交于 2021-02-17 03:35:57
问题 One way of configuring startup.cs is to check the environment based on an environmental variable, and run the appropriate code within the Configure method: // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to

Resolving Git conflicts in Visual Studio to have a commit after a bug at linking source and the server

我是研究僧i 提交于 2021-02-11 18:23:21
问题 Suddenly my local git repository bugged in a way that it didn't response to git commands, So with the help of a great professional here was able to reset, re-link it to the remote address at DevOps server. Link to the previous topic: Previous topic Now having some conflicts when trying to Cherry Commit my local repository changes to its DevOps location. Used this: git cherry-pick theversion now it seems pending. Please have a look at the below image: Don't know what should I do now. I want

How to Center an image in each column inside one row in Xamarin?

こ雲淡風輕ζ 提交于 2021-02-11 17:51:58
问题 I have this code: <Grid Margin="0,0,0,0" VerticalOptions="CenterAndExpand"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <!-- EACH IMAGE SHOULD BE CENTERED IN THE GRID 0 AND ROW 0--> <StackLayout Grid.Row="0" Grid.Column="0" Padding="0,18,0,0"> <Image Source="male" WidthRequest ="200" HeightRequest="165" TranslationX="5" TranslationY="10"

How to open a 2017 Cordova project in Visual Studio 2019

早过忘川 提交于 2021-02-11 17:27:24
问题 I have a Visual Studio project written using Visual Studio 2017 Tools for Apache Cordova, and I am unable to open it in Visual Studio 2019 (Message: incompatible) and there is no available Cordova project types. What's the best way to be able to open/edit/redeploy a Tools for Apache Cordova project? 回答1: You can't open it from visual 2019, because Microsoft stop supporting Cordova. The best way is to install visual 2017 for Apache Cordova projects only (to be lite in usage) and install latest

Visual Studio 2019 (Community Edition) - Cannot install/update Extensions

醉酒当歌 提交于 2021-02-11 12:46:55
问题 It's a fresh installation of Visual Studio 2019 Community Edition on my fresh installation of Windows 10 (64 bit) on Intel i3 laptop. Whenever I attempt to install an extension (for example, CodeMaid), I get COM ClassID not found error. I'm not sure why is this error. From google search and after referring to some articles, I think this error is due to 32bit COM on 64bit machine. Visual Studio attempts to look for the COM CLASSID under 64bit registry, but it fails since it might be under