我是 Visual Studio IDE 和学习 C# 的新手。我正在关注 Microsoft 的Web 应用程序/Razor Pages教程,并且我已经安装了 Visual Studio 和 dotnet 3.1
我正在尝试开始一个新项目,但由于某种原因,我似乎无法单击“创建”按钮。没发生什么事。我能够创建一个项目,3.0但这会导致我将要安装的最终软件包出现一些版本控制问题。
以下是有关我的 dotnet 版本控制的信息:
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.100/
Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db
.NET Core SDKs installed:
3.0.101 [/usr/local/share/dotnet/sdk]
3.1.100 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] …Run Code Online (Sandbox Code Playgroud) 最近我从 vs2017 迁移到 vs2019,vs2017 打开并显示文档正常,但 vs2019 突出显示命名空间红色并指出找不到类型或命名空间名称。
我尝试清理和重建项目,更新“Microsoft.Net.Compilers”并取消选中“并行项目初始化”,但它们都不起作用。
我正在尝试在 Visual Studio 2019 中创建自定义模板项目。在我的模板中,项目指令应该位于命名空间内。在编码时我把它们放在里面。但是当项目生成时,我在外面看到它们(我的代码被覆盖)。
如何让 Visual Studiousing在使用自定义项目模板创建的每个新项目的命名空间中放置语句?
我在运行 gulp 任务以转换我的配置文件时遇到问题。它报告以下错误:
error MSB4062: The "TransformXml" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsof t.Web.Publishing.Tasks.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confi rm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Run Code Online (Sandbox Code Playgroud)
任务的作用:
_msbuild.proj包含要转换的配置文件的文件。文件看起来是这样的(显然 Source、Transform 和 Destination 都是用真实数据填充的):<Project …Run Code Online (Sandbox Code Playgroud)