visual-studio-2019

In Visual Studio 2019 how can I remove unused usings on format document?

自古美人都是妖i 提交于 2019-12-10 12:29:01
问题 In Visual Studio 2019 how can I remove unused usings on format document? I have found instructions for previous versions of Visual Studio (Go to Tools > Options > Text Editor > C# > Code Style > Formatting.). I don't see that in Visual Studio 2019. 回答1: In Visual Studio 2019 you can remove unused usings with the Code Cleanup command: And running code cleanup also formats the document. 回答2: CTRL + K + E Will sort and remove your unused usings. 回答3: You can assign both functions to Ctrl + K,

Visual Studio cannot publish

不想你离开。 提交于 2019-12-10 11:47:49
问题 I tried this with a new project just to confirm that I have not made any errors, but Visual Studio 2019 won't publish any dot net core project. Below is the error I am getting... Any help would be much appreciated... Severity Code Description Project File Line Suppression State Error The "TransformAppSettings" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one

Latest Update brings Github error on pull, push, or sync

这一生的挚爱 提交于 2019-12-09 17:41:07
问题 In Visual Studio 2019, we have been using the GitHub extension successfully since before release. Now, all of the sudden, when we push, pull, or sync, we receive the following in the Output window: Warning: 'C:\ProgramData/Git/config' has a dubious owner: '(unknown)'. For security reasons, it is therefore ignored. To fix this, please transfer ownership to an admininstrator. 回答1: You should check if 'C:\ProgramData/Git/config' actually exists. If it doesn't you can just create it and paste the

How to create an ASP.NET website in Visual Studio 2019?

 ̄綄美尐妖づ 提交于 2019-12-08 06:54:47
问题 I am creating an application using VS 2019 and Web API (.NET Framework). I need to create a blank website, but getting only web application project template. Is there any tools do i need to be installed? Please check the below image to understand my need. VS 2017 VS 2019 回答1: To create "ASP.NET Web Site" projects in Visual Studio 2019 you need to install the "Additional project templates (previous versions)" ASP.NET Component as shown below. I have to confess I'd missed this option too as it

AnkhSVN stopped working in Visual Studio 2019

混江龙づ霸主 提交于 2019-12-08 02:39:32
问题 The past months I have successfully been using the AnkhSVN extension in Visual Studio 2019. Yesterday the extension stopped working properly. It is still tracking which files are changed, but the Pending changes pane is not showing any content. The file list and the comment box are transparent. Show changes is working, View history has the same problem as Pending changes: a transparent pane. I uninstalled the extension, downloaded it again, applied the changes as described in Installation of

Debug .NET Core source (Visual Studio 2019)

早过忘川 提交于 2019-12-08 02:34:17
问题 I use Visual Studio 2019 and .NET Core 3 web application. I'd like to debug .NET Core source code, so when an error occurs I can dive into the code and examine it in more detail. As I couldn't find an exact description on how to do it (even on Microsoft documentation site), I'll try to summarize here what I know so far. I have the following options in Visual Studio: Enable just my code Enable .NET framework source stepping Enable source server support Enable source link support The first two

How to Change Ctrl+C in Visual Studio 2017 to Copy Word, Not Entire Line

≡放荡痞女 提交于 2019-12-08 00:25:40
问题 This question is similar to Disabling single line copy in Visual Studio, except that I'm wanting to change it to just copy the word the cursor is on, if nothing is not selected. If it's on white space, sure, I don't care, copy the line, but 99% I'm trying to copy a word, not the line Is this possible? 回答1: To copy the word the caret is on, you can assign a shortcut to the following Visual Commander (developed by me) command (language C#): public class C : VisualCommanderExt.ICommand { public

.Net Core 2.2 Web API 405

邮差的信 提交于 2019-12-07 04:56:30
I am trying to setup a .net core 2.2 web api to use a post verb. Anything other than a get verb returns a 405 no matter if it is run on my local machine (w10 iis eXPRESS 10.0) or the windows server (2016 R2 IIS 8.0). I've read the other posts about disabling WebDav in your config file, adding a route, and completely removing the WebDav feature. I have done all of those to no avail. I'm just starting to develop in core and find this baffling, on the same server is a non-core web api that runs on .net framework 4.5 that processes GET,PUT,POST,DELETE without error. And yes, I have restarted the

using .NET Standard 2.1 with UWP

谁说我不能喝 提交于 2019-12-07 04:37:42
问题 I made the big mistake of taking some NuGet library updates today. It forced me to either roll back a week's worth of work, or upgrade to ASP .NET Core 3.0. I hate to use stuff that's not production, but I didn't want to untangle the libraries either, so I upgraded. Then it force me to retarget .NET Standard 2.1 libraries. Which I did. My problem now is with the client UWP code. When I try to compile, I get: error : Project '..\ClassLibrary1\ClassLibrary1.csproj' targets 'netstandard2.1'. It

Installing OData v4 Client Code Generator in Visual Studio 2019

跟風遠走 提交于 2019-12-07 00:26:27
问题 I made a OData service and I want to make a client program to call this service. I want to use OData v4 Client Code Generator, but I cannot install it in Visual Studio 2019 and I can only install it in vs2017. How can I install it in vs2019? 回答1: Since Rahul's download link is expired (and according to the comment of Mostafa, it was missing a feature), I reupload a working version of the extension for Visual Studio 2019: https://gofile.io/?c=kXvXoR Some notes about upgrading the vsix file: 1)