IDE0006警告和许多其他新的Cross Platform Xamarin应用程序,全新安装Visual Studio

Joe*_*ano 8 visual-studio xamarin.android xamarin xamarin.forms visual-studio-2017

我刚刚在运行Windows 10的PC上安装了Visual Studio 2017,并创建了一个名为"trial"的Cross Platform Xamarin应用程序(Blank和PLC).马上,错误框中出现以下警告:

IDE0006 - Error encountered while loading the project. Some project pfeatures, such as full solution alaysisis for the failed project and projects that depend on it, have been disabled.

To see what caused the issue, please try below.

1. Close Visual Studio
2. Open a Visual Studio Developer Command Prompt
3. Set environment variable "TraceDesignTime" to true (set TraceDesignTime=true)
4. Delete .vs directory/.suo file
5. Restart VS from the command prompt you set the environment variable (devenv)
6. Open the solution
7. Check 'C:\Users\Me\AppData\Local\Temp\\trial.Android_*.designtime.log' and look for the failed tasks (FAILED)
Run Code Online (Sandbox Code Playgroud)

从那以后,我尝试创建了许多其他应用程序,所有这些应用程序都至少以警告开始,通常更多.搜索其他错误不会产生任何结果 - 搜索IDE0006会产生这个以及一些更新包的建议,但我尝试了所有这些,包括更新/重新安装/使用以前版本的软件包的各种组合,删除"系统". ObjectModel"引用,重新启动,清理和重建,错误仍然存​​在.我甚至尝试卸载并重新安装Visual Studio,但没有任何改变.

Weirder仍然,当我运行我的Android项目尽管有错误,没有任何反应.在我第一次安装Visual Studio时,弹出了一个Android模拟器 - 屏幕完全是黑色的,我怀疑是预期的行为,但至少模拟器在那里 - 但自重新安装以来,什么都没发生,所有错误和警告只是从错误框中消失,因此该框完全为空(虽然顶部栏仍显示"1警告"),但我无法让它们回来.我完全按照这里的规定设置我的Android项目.

我开始按照错误中列出的7个步骤进行操作,但我找不到任何".vs"目录或".suo"文件,然后我发现我不知道自己在做什么而且我没有我想冒险进一步搞砸Visual Studio(我找不到任何关于Google的7个步骤的参考,它们也包含拼写错误,所以他们觉得过时/粗略).有没有人对这些步骤有任何经验/见解?

以下是一些其他警告不断弹出 - 我假设/希望所有警告都是由同一个基本错误引起的,但我找不到任何其他人遇到的记录,除了上面的那个.

Cannot resolve Assembly or Windows Metadata file 'System.Runtime.dll'   trial.UWP   C:\Users\User\source\repos\trial\trial\trial.UWP\trial.UWP.csproj

Type universe cannot resolve assembly: System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=jf98hs8fsihso9. trial.UWP

Could not load assembly 'trial, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?   trial.Android

The "ResolveLibraryProjectImports" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'trial, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'trial.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(String fullName)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
   at Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() trial.Android   
Run Code Online (Sandbox Code Playgroud)

我一直在梳理我的头发.我真的很期待学习Xamarin,但实际上我还没能编写一行代码.怎么可能发生?这就像我的安装已损坏或其他东西,但我不知道这是怎么可能的,特别是因为我从官方网站下载了两次.


UPDATE

我尝试了这里给出的解决方案,即构建Android项目,卸载然后重新加载它.当我构建它时,我的所有警告都消失了,但是当我卸载它时,我得到了这个单一的错误(之前偶尔会出现),这仍然存在.

The referenced component 'System.ObjectModel' could not be found.
Run Code Online (Sandbox Code Playgroud)

(我已经从引用的列表,这对错误的工作,一旦去除"System.ObjectModel",但是从那以后它的复发).当我运行应用程序时,它说"有部署错误,你想继续吗?" 像往常一样,我点击"是",再一次没有发生任何事情.即使再次构建Android项目,单个警告仍然存在.


更新2

我创建了一个新项目并将其上传到Github来演示问题:https://github.com/joeymorano/newfailure


更新3

我试过了:

1.) Cleaning
2.) Deleting all `bin` and `obj` files 
3.) Rebuilding
Run Code Online (Sandbox Code Playgroud)

但我还是有错误.可以肯定的是,我创建了一个新项目并尝试了相同的步骤,并且三个错误消失了,但仍然存在IDE0006错误.我也上传了那个项目:https://github.com/joeymorano/stack


更新4

我仍然有以下错误这个应用程序:https://github.com/joeymorano/newfailure

Error   CS0103  The name 'InitializeComponent' does not exist in the current context


Warning     The referenced component 'System.ObjectModel' could not be found.       
Run Code Online (Sandbox Code Playgroud)

这是构建诊断,构建详细程度设置为正常(这里发布的时间太长,所以我制作了一个Google文档 - 警告,它确实非常长):https://docs.google.com/document/d/ 1qUJDdjNNOBqhS_Sp9pvH6ipLx67l5fgskRX4ltluxM8 /编辑?USP =共享

Yor*_*hen 5

执行以下步骤:

    1. 清洁你的解决方案
    1. 删除bin和obj文件夹
    1. 重新打开Visual Studio并重新生成.

我已经测试了你的项目,它运行正常.

找不到引用的组件'System.ObjectModel'.

这只是一个警告,而不是错误.您可以从您删除Xamarin.Android的项目,如果你不使用INotifyPropertyChangedICommand您的内部Xamarin.Android项目.

更新:

打开你的解决方案

Xamarin.Android在模拟器上部署项目时,需要进行一些配置.如果使用arm体系结构模拟器,它会非常慢,建议使用x86体系结构模拟器,例如:

在此输入图像描述

使用x86体系结构模拟器时,需要启用硬件加速.

您可以尝试使用您的Xamarin.UWP项目,右键单击您的Stack.UWP,选择Set as StartUp Project,

在此输入图像描述

然后部署Stack.UWP你的Location Machine.如果这没有问题,我认为您需要发布完整的 Xamarin.Android部署错误,因此我们可以帮助您查明问题.


更新2:

右键单击您的项目解决方案,打开Manage Nuget Packages for solution,将Xamarin.Forms包更新到最新版本.然后清理您的解决方案,删除bin&obj文件夹并再次重启VS.