C# 无法解析程序集或windows元数据文件;Mono.Android.dll“;

C# 无法解析程序集或windows元数据文件;Mono.Android.dll“;,c#,android,visual-studio,xamarin,C#,Android,Visual Studio,Xamarin,我一直在VisualStudio中使用Xamarin的跨平台功能,并且正在使用UWP进行调试。我已经工作了一段时间,这个错误突然出现了 我已重新安装visual studio并关闭/重新打开该项目。我还清除了金块的缓存。我甚至下载了android sdk并安装了尽可能多的软件包。我一直在打开发生此错误的文件,但没有发现问题。我想我不知怎么错过了一个包裹,但我不知道该怎么办 .csproj代码 <?xml version="1.0" encoding="utf-8"?> <Pro

我一直在VisualStudio中使用Xamarin的跨平台功能,并且正在使用UWP进行调试。我已经工作了一段时间,这个错误突然出现了

我已重新安装visual studio并关闭/重新打开该项目。我还清除了金块的缓存。我甚至下载了android sdk并安装了尽可能多的软件包。我一直在打开发生此错误的文件,但没有发现问题。我想我不知怎么错过了一个包裹,但我不知道该怎么办

.csproj代码

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    <ProjectGuid>{FAEE398B-7B29-4F06-9680-AC61EAC98C26}</ProjectGuid>
    <OutputType>AppContainerExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ApPOYNTments.UWP</RootNamespace>
    <AssemblyName>ApPOYNTments.UWP</AssemblyName>
    <DefaultLanguage>en-US</DefaultLanguage>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <TargetPlatformVersion>10.0.15063.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
    <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
    <EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
    <FileAlignment>512</FileAlignment>
    <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <PackageCertificateKeyFile>ApPOYNTments.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\ARM\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
    <OutputPath>bin\ARM\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>ARM</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x64\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    <OutputPath>bin\x64\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x64</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    <DebugSymbols>true</DebugSymbols>
    <OutputPath>bin\x86\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <NoWarn>;2008</NoWarn>
    <DebugType>full</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    <OutputPath>bin\x86\Release\</OutputPath>
    <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
    <Optimize>true</Optimize>
    <NoWarn>;2008</NoWarn>
    <DebugType>pdbonly</DebugType>
    <PlatformTarget>x86</PlatformTarget>
    <UseVSHostingProcess>false</UseVSHostingProcess>
    <ErrorReport>prompt</ErrorReport>
    <Prefer32Bit>true</Prefer32Bit>
    <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
  </PropertyGroup>
  <ItemGroup>
    <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
    <None Include="project.json" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="UnitTest.cs" />
  </ItemGroup>
  <ItemGroup>
    <AppxManifest Include="Package.appxmanifest">
      <SubType>Designer</SubType>
    </AppxManifest>
    <None Include="ApPOYNTments.UWP_TemporaryKey.pfx" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Properties\Default.rd.xml" />
    <Content Include="Assets\LockScreenLogo.scale-100.png" />
    <Content Include="Assets\LockScreenLogo.scale-125.png" />
    <Content Include="Assets\LockScreenLogo.scale-150.png" />
    <Content Include="Assets\LockScreenLogo.scale-200.png" />
    <Content Include="Assets\LockScreenLogo.scale-400.png" />
    <Content Include="Assets\SplashScreen.scale-100.png" />
    <Content Include="Assets\SplashScreen.scale-125.png" />
    <Content Include="Assets\SplashScreen.scale-150.png" />
    <Content Include="Assets\SplashScreen.scale-200.png" />
    <Content Include="Assets\SplashScreen.scale-400.png" />
    <Content Include="Assets\Square150x150Logo.scale-200.png" />
    <Content Include="Assets\Square44x44Logo.scale-100.png" />
    <Content Include="Assets\Square44x44Logo.scale-125.png" />
    <Content Include="Assets\Square44x44Logo.scale-150.png" />
    <Content Include="Assets\Square44x44Logo.scale-200.png" />
    <Content Include="Assets\Square44x44Logo.scale-400.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-16_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-32_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-48_altform-unplated.png" />
    <Content Include="Assets\Square44x44Logo.targetsize-256_altform-unplated.png" />
    <Content Include="Assets\StoreLogo.png" />
    <Content Include="Assets\Wide310x150Logo.scale-100.png" />
    <Content Include="Assets\Wide310x150Logo.scale-125.png" />
    <Content Include="Assets\Wide310x150Logo.scale-150.png" />
    <Content Include="Assets\Wide310x150Logo.scale-200.png" />
    <Content Include="Assets\Wide310x150Logo.scale-400.png" />
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Page Include="MainPage.xaml">
      <Generator>MSBuild:Compile</Generator>
      <SubType>Designer</SubType>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Reference Include="PoyntSDK1.2.107">
      <HintPath>..\..\..\..\..\Documents\Poynt Output-Build\PoyntSDK1.2.107.dll</HintPath>
    </Reference>
  </ItemGroup>
  <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
    <VisualStudioVersion>14.0</VisualStudioVersion>
  </PropertyGroup>
  <Import Project="..\ApPOYNTments\ApPOYNTments.projitems" Label="Shared" Condition="Exists('..\ApPOYNTments\ApPOYNTments.projitems')" />
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

调试
x86
{FAEE398B-7B29-4F06-9680-AC61EAC98C26}
AppContainerExe
性质
appointments.UWP
appointments.UWP
恩美
UAP
10.0.15063.0
10.0.10586.0
14
真的
512
{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
appointments.UWP_TemporaryKey.pfx
真的
bin\ARM\Debug\
调试;痕迹;NETFX_核心;WINDOWS_UWP
;2008
满的
手臂
假的
促使
真的
bin\ARM\Release\
痕迹;NETFX_核心;WINDOWS_UWP
真的
;2008
pdbonly
手臂
假的
促使
真的
真的
真的
bin\x64\Debug\
调试;痕迹;NETFX_核心;WINDOWS_UWP
;2008
满的
x64
假的
促使
真的
bin\x64\Release\
痕迹;NETFX_核心;WINDOWS_UWP
真的
;2008
pdbonly
x64
假的
促使
真的
真的
真的
bin\x86\Debug\
调试;痕迹;NETFX_核心;WINDOWS_UWP
;2008
满的
x86
假的
促使
真的
bin\x86\Release\
痕迹;NETFX_核心;WINDOWS_UWP
真的
;2008
pdbonly
x86
假的
促使
真的
真的
App.xaml
MainPage.xaml
设计师
MSBuild:编译
设计师
MSBuild:编译
设计师
..\..\..\..\..\..\Documents\Poynt输出生成\PoyntSDK1.2.107.dll
14
更新: 我发现这个错误,似乎是内部问题

1> C:\Users\dedawg\Documents\visualstudio 2017\ArchitectureExplorer\MSBuild\Microsoft\WindowsXaml\v15.0\8.2\Microsoft.Windows.UI.Xaml.Common.targets(354,5): Xaml内部错误WMC9999:无法解析类型universe 程序集:Mono.Android,版本=0.0.0.0,文化=中性, PublicKeyToken=84e04ff9cfb79065

下面是文件指向的特定部分

 <CompileXaml
            LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
            Language="$(Language)"
            RootNamespace="$(RootNamespace)"
            XamlPages="@(Page)"
            XamlApplications="@(ApplicationDefinition)"
            SdkXamlPages="@(SdkXamlItems)"
            PriIndexName="$(PriIndexName)"
            ProjectName="$(MsBuildProjectName)"
            IsPass1="False"
            DisableXbfGeneration="$(DisableXbfGeneration)"
            CodeGenerationControlFlags="$(XamlCodeGenerationControlFlags)"
            ClIncludeFiles="@(ClInclude)"
            CIncludeDirectories="$(XamlCppIncludeDirectories)"
            LocalAssembly="$(LocalAssembly)"
            ProjectPath="$(MSBuildProjectFullPath)"
            OutputPath="$(XamlGeneratedOutputPath)"
            OutputType="$(OutputType)"
            ReferenceAssemblyPaths="@(ReferenceAssemblyPaths)"
            ReferenceAssemblies="@(XamlReferencesToCompile)"
            ForceSharedStateShutdown="False"
            CompileMode="RealBuildPass2"
            XAMLFingerprint="$(XAMLFingerprint)"
            FingerprintIgnorePaths="$(XAMLFingerprintIgnorePaths)"
            VCInstallDir="$(VCInstallDir)"
            WindowsSdkPath="$(WindowsSdkPath)"
            SavedStateFile="$(XamlSavedStateFilePath)"
            RootsLog="$(XamlRootsLog)"
            SuppressWarnings="$(SuppressXamlWarnings)"
            TargetPlatformMinVersion="$(TargetPlatformMinVersion)"
            BuildConfiguration="$(Configuration)"
            DisableXbfLineInfo="$(DisableXbfLineInfo)">
      <Output Condition=" '$(ManagedAssembly)'!='false' " ItemName="Compile"   TaskParameter="GeneratedCodeFiles" />
      <Output Condition=" '$(ManagedAssembly)'=='false' " ItemName="XamlGFiles" TaskParameter="GeneratedCodeFiles" />

      <!--
      FileWrites is used in Microsoft.Common.Targets for "Clean" build 
      -->
      <Output ItemName="FileWrites" TaskParameter="GeneratedCodeFiles" />
      <Output ItemName="FileWrites" TaskParameter="GeneratedXamlFiles" />
      <Output ItemName="FileWrites" TaskParameter="GeneratedXbfFiles" />
      <Output ItemName="_GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
      <Output ItemName="_GeneratedXamlFiles" TaskParameter="GeneratedXamlFiles" />
      <Output ItemName="_GeneratedXbfFiles" TaskParameter="GeneratedXbfFiles" />
    </CompileXaml>


对于大多数在这里查看的人来说,遵循此说明应该可以解决问题。我发现了错误。在我的参考资料中,我添加了一个Poynt库。虽然这不是Mono.Android,但它包含了引用。删除该库修复了问题,但是我确实需要该库,但这是另一个问题。

您的UWP项目似乎有一个
MonoAndroid
引用,请尝试从您的
UWP.csproj
文件中删除此引用。我刚刚打开了我的UWP文件,没有引用。不过我相信你的答案是正确的,让我继续寻找@YorkShen MSFT你介意分享一个可以通过在线回购重现问题的基本演示吗?确保我们正在验证您使用的完全相同的东西。问题是我无法公开显示此项目,但我找到了一个类似问题的链接,我相信解决方案就是您所说的。请发布您的
UWP.csproj
代码。
 <CompileXaml
            LanguageSourceExtension="$(DefaultLanguageSourceExtension)"
            Language="$(Language)"
            RootNamespace="$(RootNamespace)"
            XamlPages="@(Page)"
            XamlApplications="@(ApplicationDefinition)"
            SdkXamlPages="@(SdkXamlItems)"
            PriIndexName="$(PriIndexName)"
            ProjectName="$(MsBuildProjectName)"
            IsPass1="False"
            DisableXbfGeneration="$(DisableXbfGeneration)"
            CodeGenerationControlFlags="$(XamlCodeGenerationControlFlags)"
            ClIncludeFiles="@(ClInclude)"
            CIncludeDirectories="$(XamlCppIncludeDirectories)"
            LocalAssembly="$(LocalAssembly)"
            ProjectPath="$(MSBuildProjectFullPath)"
            OutputPath="$(XamlGeneratedOutputPath)"
            OutputType="$(OutputType)"
            ReferenceAssemblyPaths="@(ReferenceAssemblyPaths)"
            ReferenceAssemblies="@(XamlReferencesToCompile)"
            ForceSharedStateShutdown="False"
            CompileMode="RealBuildPass2"
            XAMLFingerprint="$(XAMLFingerprint)"
            FingerprintIgnorePaths="$(XAMLFingerprintIgnorePaths)"
            VCInstallDir="$(VCInstallDir)"
            WindowsSdkPath="$(WindowsSdkPath)"
            SavedStateFile="$(XamlSavedStateFilePath)"
            RootsLog="$(XamlRootsLog)"
            SuppressWarnings="$(SuppressXamlWarnings)"
            TargetPlatformMinVersion="$(TargetPlatformMinVersion)"
            BuildConfiguration="$(Configuration)"
            DisableXbfLineInfo="$(DisableXbfLineInfo)">
      <Output Condition=" '$(ManagedAssembly)'!='false' " ItemName="Compile"   TaskParameter="GeneratedCodeFiles" />
      <Output Condition=" '$(ManagedAssembly)'=='false' " ItemName="XamlGFiles" TaskParameter="GeneratedCodeFiles" />

      <!--
      FileWrites is used in Microsoft.Common.Targets for "Clean" build 
      -->
      <Output ItemName="FileWrites" TaskParameter="GeneratedCodeFiles" />
      <Output ItemName="FileWrites" TaskParameter="GeneratedXamlFiles" />
      <Output ItemName="FileWrites" TaskParameter="GeneratedXbfFiles" />
      <Output ItemName="_GeneratedCodeFiles" TaskParameter="GeneratedCodeFiles" />
      <Output ItemName="_GeneratedXamlFiles" TaskParameter="GeneratedXamlFiles" />
      <Output ItemName="_GeneratedXbfFiles" TaskParameter="GeneratedXbfFiles" />
    </CompileXaml>