在Mac Visual Studio上运行Web App时出错

问题描述 投票:0回答:1

我是Visual Studio的新手。我从Azure Multi-tenant下载了一个Web应用程序。但是,当我尝试运行该应用程序时,我收到以下错误消息:

/Users/MySystem/Desktop/active-directory-dotnet-webapp-multitenant-openidconnect/TodoListWebApp/TodoListWebApp.csproj(3,3): Error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. (MSB4019) 

我已经尝试修改此link中给出的.csproj文件,但无法解决问题。请注意我正在使用Mac Visual Studio。

任何想法或建议都会感激不尽。

macos azure-web-sites visual-studio-mac
1个回答
1
投票

有源目录的dotnet-web应用-多租户-openidconnect / TodoListWebApp

通过在网上搜索项目名称,我发现它是a sample .NET 4.5 MVC web app

我正在使用Mac Visual Studio

Visual Studio for Mac中的Web应用程序基于.NET Core,它无法与sln / csproj文件一起使用。我建议您在Visual Studio for Mac上创建一个新项目,并从原始项目中复制文件。

由于Mac上的.NET版本是.NET Core,这与示例应用程序(.NET 4.5)不同。您还需要修改一些代码。例如,ASP.NET Core应用程序不包含Global.asax。

有关如何创建asp.net核心应用程序的更多信息,以下链接供您参考。

Create an ASP.NET Core MVC app with Visual Studio Code

© www.soinside.com 2019 - 2024. All rights reserved.