问题标签 [visual-studio-2019]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c# - c#程序如何获取VS 2019的安装位置?
如何从注册表或 C# 中的其他方式获取 VS2019 Preview 安装路径(C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional)?
请建议这样做的方法。
visual-studio - 如何生成 project.assets.json
我创建了一个新的 .NET Standard 项目并尝试在不添加任何代码的情况下进行构建,我得到了
“资产文件 'E:\Storage\Google Drive\My Content\My Documents\My LC TECH\Projects\LC Development\LC.Assets\obj\project.assets.json' 未找到。运行 NuGet 包还原以生成此文件文件。”
我试图运行dotnet restore但没有运气。
如何创建文件或删除对它的引用?
我使用 Visual Studio 2019 预览版,但在使用 Visual Studio 2017 时出现同样的错误。
c# - 如何指定字形渲染到哪个边距?
来自https://docs.microsoft.com/en-us/visualstudio/extensibility/walkthrough-creating-a-margin-glyph?view=vs-2017的代码片段将引导您完成创建边距字形、实现TaggerProvider
/ITagger<T>
和GlyphFactoryProvider
/ GlyphFactory
. 这会将字形渲染到出现断点的相同边距。
我想创建一个自定义边距,但使用内置的 Glyph/Tagger 逻辑来管理该 Glyph 的位置等。如何在 Glyph / Tagger 对象和IWpfTextViewMarginProvider
/之间创建关系IWpfTextViewMargin
?
visual-studio-2019 - VS 2019 - 如何选择添加新项目的位置
对于 VS 2017 解决方案,当您右键单击解决方案并选择添加新项目时,在模板页面中有一个选择目标文件夹(如果与解决方案文件夹不同)的选项,但它似乎不是一个选项VS 2019 预览版。反正有那个选项出现吗?(它甚至是 2019 年的一种选择吗?)
澄清一下 - 这是当您已经打开一个解决方案并尝试向该解决方案添加一个新项目时
visual-studio - 如何修复“命名空间microsoft.visualstudio中不存在类型或命名空间名称'xmleditor'(您是否缺少程序集引用?)”
当我在 Visual Studio 2019 预览版中导入在 Visual Studio 2017 中创建的我的 Visual Studio 扩展项目时,我收到许多如下所示的 xml 错误。
谁能建议如何解决这个问题?
visual-studio - vs2019 vsix 没有安装
在这里,我附上了我的错误日志。
visual-studio - Reference GAC assemblies in new CSPROJ format?
I am using Visual Studio 2019 preview 2.1. I have a .NET Framework 4.6.1 class library C# project which has some Azure references in the old csproj project format (ToolsVersion="15.0"). This old csproj currently builds and works just fine. I am attempting to migrate to the new project format. Everything is going well except for the fact that I have one reference which doesn't come from NuGet -- it comes from the GAC: Microsoft.WindowsAzure.ServiceRuntime. However, I haven't figured out how to get the new project format to find the assembly. For example here is the new project file:
In fact, that Microsoft.WindowsAzure.ServiceRuntime reference is the exact line from the old format. When loading this in VS it produces the following warning:
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "Microsoft.WindowsAzure.ServiceRuntime, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. MyProject C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2114
I attempted to remove the version:
But that did not help. If I remove it and try to add the reference from the VS user interface, I see there are a bunch of Microsoft.* and System.* options in 'Framework' (the GAC), but Microsoft.WindowsAzure.ServiceRuntime is not one of them. Just to confirm I started up ILSpy and chose "Open From GAC..." and sure enough it is there along with a bunch of other assemblies which do not appear in the VS user interface.
How can I get VS to load this reference from the GAC?
Thanks
c# - 无法解析类型“Microsoft.Extensions.Logging.ILogger`1[WebApplication1.Startup]”的服务
我在 Visual Studio 2019 Preview 2.2 中使用默认模板创建了一个 ASP.NET Core 3.0 Web 应用程序,并尝试在 Startup 中注入一个 ILogger:
在 Program.cs 中,我还调用了 ConfigureLogging() 方法:
它在 ASP.NET Core 2.x 中有效,但在 ASP.NET Core 3 中失败并出现以下错误:
关于是什么导致这种行为的任何想法?
在默认“Web 应用程序”模板的完整 Program.cs 和 Startup.cs 文件下方,仅添加了日志记录。
程序.cs
启动.cs