{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/30106","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/30106/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/30106/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/30106/events","html_url":"https://github.com/dotnet/corefx/issues/30106","id":328813329,"node_id":"MDU6SXNzdWUzMjg4MTMzMjk=","number":30106,"title":"System.Numerics.Vectors.dll fails to load","user":{"login":"colgreen","id":9821346,"node_id":"MDQ6VXNlcjk4MjEzNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/9821346?v=4","gravatar_id":"","url":"https://api.github.com/users/colgreen","html_url":"https://github.com/colgreen","followers_url":"https://api.github.com/users/colgreen/followers","following_url":"https://api.github.com/users/colgreen/following{/other_user}","gists_url":"https://api.github.com/users/colgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/colgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colgreen/subscriptions","organizations_url":"https://api.github.com/users/colgreen/orgs","repos_url":"https://api.github.com/users/colgreen/repos","events_url":"https://api.github.com/users/colgreen/events{/privacy}","received_events_url":"https://api.github.com/users/colgreen/received_events","type":"User","site_admin":false},"labels":[{"id":147576314,"node_id":"MDU6TGFiZWwxNDc1NzYzMTQ=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.Numerics","name":"area-System.Numerics","color":"d4c5f9","default":false},{"id":145399955,"node_id":"MDU6TGFiZWwxNDUzOTk5NTU=","url":"https://api.github.com/repos/dotnet/corefx/labels/bug","name":"bug","color":"207de5","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-06-03T09:21:38Z","updated_at":"2018-06-06T22:56:32Z","closed_at":"2018-06-06T19:27:48Z","author_association":"NONE","body":"This relates to use of the System.Numerics.Vectors (nuget package 4.5) in a dotnet standard 2.0 library, and consuming that library from a Windows .NET Framework application.\r\n\r\nWhen the runtime attempts to load System.Numerics.Vectors this error is reported...\r\n\r\n```\r\nSystem.IO.FileNotFoundException\r\n  HResult=0x80070002\r\n  Message=Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.\r\n```\r\nReverting to System.Numerics.Vectors 4.4.0 resolves the problem.\r\n\r\nExample code:\r\n\r\ndotnet standard 2.0 library class...\r\n```c#\r\nnamespace FooLib\r\n{\r\n    public class Class1\r\n    {\r\n        public void DoStuff(int[] arr)\r\n        {\r\n            var va = new Vector<int>(arr, 0);\r\n            var vb = new Vector<int>(arr, 4);\r\n            var vc = va + vb;\r\n            vc.CopyTo(arr, 0);\r\n        }\r\n    }\r\n}\r\n```\r\n.NET Franework 4.7 console app\r\n```c#\r\n    class Program\r\n    {\r\n        static void Main(string[] args)\r\n        {\r\n            int[] arr = new int[32];\r\n\r\n            Class1 c1 = new Class1();\r\n            c1.DoStuff(arr);\r\n\r\n            Console.WriteLine(arr[0]);\r\n        }\r\n    }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/395239793","html_url":"https://github.com/dotnet/corefx/issues/30106#issuecomment-395239793","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/30106","id":395239793,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTIzOTc5Mw==","user":{"login":"colgreen","id":9821346,"node_id":"MDQ6VXNlcjk4MjEzNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/9821346?v=4","gravatar_id":"","url":"https://api.github.com/users/colgreen","html_url":"https://github.com/colgreen","followers_url":"https://api.github.com/users/colgreen/followers","following_url":"https://api.github.com/users/colgreen/following{/other_user}","gists_url":"https://api.github.com/users/colgreen/gists{/gist_id}","starred_url":"https://api.github.com/users/colgreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colgreen/subscriptions","organizations_url":"https://api.github.com/users/colgreen/orgs","repos_url":"https://api.github.com/users/colgreen/repos","events_url":"https://api.github.com/users/colgreen/events{/privacy}","received_events_url":"https://api.github.com/users/colgreen/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T22:56:32Z","updated_at":"2018-06-06T22:56:32Z","author_association":"NONE","body":"Here you go:\r\n\r\n[VectorProto-v1.zip](https://github.com/dotnet/corefx/files/2078374/VectorProto-v1.zip)\r\n\r\nIt took a while to distill the problem down to a demo solution with only the relevant aspects. In summary, the attached solution contains a .NET Framework 4.7 **Unit Test** project that refers to a dotnet standard 2.0 library project.\r\n\r\nBoth the unit test project and the lib project refer to the System.Numerics.Vectors nuget directly, in the original solution this was because there was a unit test that indicates if the hardware acceleration is enabled or not:\r\n\r\n```\r\n        [TestMethod]\r\n        public void TestHardwareAccelerated()\r\n        {\r\n            if(!Vector.IsHardwareAccelerated) {\r\n                Assert.Inconclusive(\"Hardware accelerations not available. Hardware acceleration is available on supporting CPUs only, and only for x64 builds with optimization enabled (i.e. release builds).\");\r\n            }\r\n            ...\r\n        }\r\n```\r\n\r\nAs well as other tests against the code in the lib that uses System.Numerics.Vectors if IsHardwareAccelerated == true.\r\n\r\nHence, when I saw the new SNV nuget I updated both projects, ran my unit tests and they started failing! I reverted back to nuget 4.4.0 and they all passed.\r\n"}}
{"actor":{"display_login":"colgreen"}}