visual-studio-2019

ToolsVersion in Visual Studio 2019

梦想与她 提交于 2020-08-10 22:13:04
问题 I am doing the migration of several projects from VS2010 to VS2019. Those projects have Tools Version 4 in their vcxprojs: <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> Target VS is VS2019 v16.5.0, MSBuild version is 16.5.0.12403, so I am trying to set ToolsVersion to 16.5: <Project DefaultTargets="Build" ToolsVersion="16.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> But it seems that MSBuild doesn't like it:

Weird LNK2001 errors after migration to VS2019

限于喜欢 提交于 2020-08-10 18:57:50
问题 After moving my code from VS2017 to VS2019 I stumbled into strange linker behaviour -- it seems like it references objects from static library that it shouldn't have (which in turn refer to symbols that can't be resolved). Basically, I end up with this: 1>tools.lib(object_storage_azure.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl azure::storage::operation_context::operation_context(void)" (__imp_??0operation_context@storage@azure@@QEAA@XZ) 1>tools

How to change the Visual Studio build output verbosity through scripting?

懵懂的女人 提交于 2020-08-10 13:02:38
问题 Note, that I am not talking about msbuild output verbosity, but about devenv - the IDE: It uses registry for that. However, in VS 2015 the registry keys were clear and the following simple script did the job: Param( [Parameter(Mandatory)][ValidateRange(1,4)][int]$level ) $path = "HKCU:\Software\Microsoft\VisualStudio\14.0\General" Set-ItemProperty -Path $path -Name MSBuildLogFileVerbosity -Value $level -Type DWord Set-ItemProperty -Path $path -Name MSBuildLoggerVerbosity -Value $level -Type

Cannot add assemblies to .Net Core application in Visual Studio 2019

≯℡__Kan透↙ 提交于 2020-08-10 04:07:35
问题 When I try to add a missing assembly to my project (for unit testing specifically) I noticed that the Assemblies tab is missing in the "Add Reference" dialog , see: Is this a bug or a expected behavior? If it's expected how we are supposed to add the missing assemblies. Note that I already tried through Nuget package manager and still didn't work. 回答1: It is correct behaviour. The Assemblies tab is not available for Net Core projects. You wont be able to add assemblies from your system,

Cannot add assemblies to .Net Core application in Visual Studio 2019

最后都变了- 提交于 2020-08-10 04:05:38
问题 When I try to add a missing assembly to my project (for unit testing specifically) I noticed that the Assemblies tab is missing in the "Add Reference" dialog , see: Is this a bug or a expected behavior? If it's expected how we are supposed to add the missing assemblies. Note that I already tried through Nuget package manager and still didn't work. 回答1: It is correct behaviour. The Assemblies tab is not available for Net Core projects. You wont be able to add assemblies from your system,

Visual Studio 2019 project upgrade to C#8 build failed

為{幸葍}努か 提交于 2020-08-09 10:47:34
问题 For one of our projects we're trying to upgrade to use C#8 instead of C#7.1. The upgrade looks like it works, because the compiler looks like it takes C#8 statements (it doesn't mark it as an error). However, when I build the project I get a build failed without any errors showing initially. The code to test C#8 is of the following lines: private string TestCSharp8(int x) { return x switch { 0 => "ZERO", 1 => "ONE", 2 => "TWO", 3 => "THREE", _ => "OTHER" }; } The IDE is accepting this code

Visual Studio 2019 project upgrade to C#8 build failed

一笑奈何 提交于 2020-08-09 10:46:04
问题 For one of our projects we're trying to upgrade to use C#8 instead of C#7.1. The upgrade looks like it works, because the compiler looks like it takes C#8 statements (it doesn't mark it as an error). However, when I build the project I get a build failed without any errors showing initially. The code to test C#8 is of the following lines: private string TestCSharp8(int x) { return x switch { 0 => "ZERO", 1 => "ONE", 2 => "TWO", 3 => "THREE", _ => "OTHER" }; } The IDE is accepting this code

How to close/dispose tool window when visual studio solution closed and create/open toolwindow again in an extension

怎甘沉沦 提交于 2020-08-06 06:09:08
问题 I created a tool window inside visual studio extension using https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-a-tool-window?view=vs-2019. I show some documentation in it based on user inputs from the wizard.Ex : User selected Tab, I show Tab related documentation User closed the solution User created another project , He changed the user input Ex : Bot is selected Expected : Bot documentation to be shown Actual : Tab documentation is shown(Tool window content doesn't change)

Hello World driver won't compile correctly

醉酒当歌 提交于 2020-08-04 07:36:23
问题 I started out driver development, however I followed some tutorials I met online here and I am trying to compile my driver into a simple .sys file. The code looks like this: #include <ntddk.h> #include <wdf.h> #define UNREFERENCED_PARAMETER(P) (P) VOID DriverUnload(PDRIVER_OBJECT driver) { DbgPrint("first:HelloWorld End!"); } NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject, PUNICODE_STRING pUnicodeString) { DbgPrint("first:HelloWorld Begin!"); pDriverObject->DriverUnload = DriverUnload;

Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'

这一生的挚爱 提交于 2020-07-21 07:58:10
问题 I am using asp.net core 3.1 docker enabled project template (VS2019) to develop a web API. There are no compilation errors. While running the project, in the output window of the VS2019 I see the following message: Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. Loaded '/usr/share/dotnet/shared/Microsoft.NETCore.App/3.1.0/System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My