Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

时间:2022-11-30 11:37:16

****EDIT UPDATE****

****编辑更新****

I have tried to create a shared project and this was the following issue:

我试图创建一个共享项目,这是以下问题:

Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

I am new to Xamarin Forms on Visual Studio and was confused about the recent changes to the PCL and .NET Standard class library updates. Currently, I am trying to create a Cross-Platform App (Xamarin.Forms) on Visual Studio 2017 15.5.7 using the following settings:

我是Visual Studio上Xamarin Forms的新手,并对最近对PCL和.NET Standard类库更新的更改感到困惑。目前,我正在尝试使用以下设置在Visual Studio 2017 15.5.7上创建跨平台应用程序(Xamarin.Forms):

I created this project using a different name (rga_inventory_app). Stating this now so that no one gets confused on the error output at the bottom. Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

我使用不同的名称(rga_inventory_app)创建了这个项目。现在说明这一点,以便没有人对底部的错误输出感到困惑。

Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

Xamarin Forms不会在Visual Studio 2017中创建.csproj文件

Is this normal behavior for creating a cross-platform Xamarin Forms project on Visual Studio? Am I required to create a csproj file myself? Reading through the Xamarin documentation, I don't see anything on explicitly the .csproj files in VS2017. This causes trouble in updating the NuGet packages as well as its attempting to reload the project.

这是在Visual Studio上创建跨平台Xamarin Forms项目的正常行为吗?我需要自己创建一个csproj文件吗?通过Xamarin文档阅读,我在VS2017中没有看到明确的.csproj文件。这会导致更新NuGet包以及尝试重新加载项目时出现问题。

1 个解决方案

#1


0  

I have found what the issue is. The initial creation of a Xamarin Forms project had some buggy startup operations that broke the referencing from the Android and iOS projects to the .NET Standard Library project. I had to go into each project and re-reference the .NET Standard project to the Android and iOS.

我发现了问题所在。最初创建的Xamarin Forms项目有一些错误的启动操作,打破了从Android和iOS项目到.NET标准库项目的引用。我不得不进入每个项目并将.NET Standard项目重新引用到Android和iOS。

I later found out that the default installation were missing certain android SDK files and had to be later installed through the Xamarin Android SDK manager to resolve the referencing issue, as that may have been causing errors during start up (maybe the process was looking for a certain SDK version). I decided to install all versions from Oreo down to Lollipop.

我后来发现默认安装缺少某些Android SDK文件,后来必须通过Xamarin Android SDK管理器安装才能解决引用问题,因为这可能在启动过程中导致错误(也许这个过程正在寻找一个某些SDK版本)。我决定安装从Oreo到Lollipop的所有版本。

I hope this helps anyone else that's having this issue when they first start off trying to use Xamarin Forms.

我希望这可以帮助其他人在第一次尝试使用Xamarin Forms时遇到此问题。

#1


0  

I have found what the issue is. The initial creation of a Xamarin Forms project had some buggy startup operations that broke the referencing from the Android and iOS projects to the .NET Standard Library project. I had to go into each project and re-reference the .NET Standard project to the Android and iOS.

我发现了问题所在。最初创建的Xamarin Forms项目有一些错误的启动操作,打破了从Android和iOS项目到.NET标准库项目的引用。我不得不进入每个项目并将.NET Standard项目重新引用到Android和iOS。

I later found out that the default installation were missing certain android SDK files and had to be later installed through the Xamarin Android SDK manager to resolve the referencing issue, as that may have been causing errors during start up (maybe the process was looking for a certain SDK version). I decided to install all versions from Oreo down to Lollipop.

我后来发现默认安装缺少某些Android SDK文件,后来必须通过Xamarin Android SDK管理器安装才能解决引用问题,因为这可能在启动过程中导致错误(也许这个过程正在寻找一个某些SDK版本)。我决定安装从Oreo到Lollipop的所有版本。

I hope this helps anyone else that's having this issue when they first start off trying to use Xamarin Forms.

我希望这可以帮助其他人在第一次尝试使用Xamarin Forms时遇到此问题。