Getting error message when building xamarin forms sample application

binoycbinoyc Member ✭✭

Facing the below error message when building xamarin forms sample application

"Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. sample_app\App.xaml"

Tools used
Visual Studio 2017 Community
Xamarin forms for Android

Please let me know if anyone know the solution

Thanks

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai

    Try to add the following code in your CSPROJ file.

    <Target Name="IncludeNETStandardFacadeInVSIX" AfterTargets="ImplicitlyExpandNETStandardFacades">
      <ItemGroup>
        <Content Include="@(_NETStandardLibraryNETFrameworkLib)" Condition="%(Filename) == 'netstandard'">
          <IncludeInVSIX>True</IncludeInVSIX>
          <VSIXSubPath>/</VSIXSubPath>
        </Content>
      </ItemGroup>
    </Target>
    

    How to open CSPROJ file ?

    1. Right click on your project in solution explorer and select Unload Project.
    2. Right click on the project (tagged as unavailable in solution explorer) and click "Edit yourproj.csproj". This will open up your CSPROJ file for editing.
    3. After making any changes you want, save and close the file.

    Refer to https://github.com/dotnet/roslyn/issues/25586

Sign In or Register to comment.