0

After I added to my working UWP app a reference to a member in a .NET Standard 2.0 class library, that I added, now when I run it I get this error:

enter image description here

System.IO.FileNotFoundException HResult=0x80070002 Message=Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. Source=CameraFrames StackTrace: at FrameRenderer.ProcessFrame(MediaFrameReference frame) in C:\PRIMARY\WORK\CAMERA READER\Samples\CameraFrames\cs\SOURCE\FrameRenderer.cs:line 393 at SDKTemplate.Scenario1_DisplayDepthColorIR.FrameReader_FrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args) in C:\PRIMARY\WORK\CAMERA READER\Samples\CameraFrames\cs\Scenario1_DisplayDepthColorIR.xaml.cs:line 315

Here is the UWP app code that breaks it. If I remove the "bool aa"... line, it works.

        public void ProcessFrame( MediaFrameReference frame)
    {
                       // TEST MULTI-PROJ
                       bool aa = UWP_BRIDGE_DotNet_Standard_ClassLibrary.Class1.flag;

Here is the code in the .NET Standard 2.0 class lib...

    using System;

namespace UWP_BRIDGE_DotNet_Standard_ClassLibrary
{
    public class Class1
    {
        public static bool flag = false;
        public static string buffer = "HELLO";
    }
}

I set UWP project properties > Targeting > Target & Min version both to Windows 10 v 1803 and it still errors.

1
  • I cannot reproduce your problem when using .NET Standard class library and 16299 SDK as Min/Max target version. And I've checked my class library, which is using .NET Standard.Library 2.0.3. What's your Visual Studio version? Is it possible that your Visual Studio needs to be updated?
    – Barry Wang
    Commented Feb 5, 2019 at 2:54

1 Answer 1

0

May the problem is from .NET framework.

you must target your .NET framework to 4.6.1 at least if you using .NET Core 2.0 Check the table in this link

https://learn.microsoft.com/en-us/dotnet/standard/net-standard

Not the answer you're looking for? Browse other questions tagged or ask your own question.