Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not load file or assembly 'System.Security.Cryptography.Algorithms' on net46 #45

Closed
eerhardt opened this issue Aug 15, 2016 · 0 comments · Fixed by #46
Closed

Comments

@eerhardt
Copy link
Member

When trying to build in Dev15 using the Microsoft.DotNet.Core.Sdk nuget package, we get the following error:

The "GenerateDepsFile" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Security.Cryptography.Algorithms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.DotNet.Core.Build.Tasks.DependencyContextBuilder.GenerateRuntimeSignature(IEnumerable`1 runtimeExports)
at Microsoft.DotNet.Core.Build.Tasks.DependencyContextBuilder.Build(String projectName, String projectVersion, CompilationOptions compilerOptions, LockFile lockFile, NuGetFramework framework, String runtime)
at Microsoft.DotNet.Core.Build.Tasks.GenerateDepsFile.Execute()

This is because this assembly is not deployed with the .NET Framework v4.6. Instead, apps are expected to deploy this assembly when they target net46.

There are other CoreFX libraries that have the same situation (ex. System.IO.FileSystem), but those assemblies appear to be deployed with MSBuild in Dev15. However, System.Security.Cryptography.Algorithms is not.

To workaround this error for now, we will package System.Security.Cryptography.Algorithms in our nuget package, so it can be loaded on net46.

nguerrera pushed a commit that referenced this issue Oct 10, 2016
…r NuGet package.

This allows us to put platform-specific dependencies in the NuGet package, and fixes the issue of getting FileNotFound 'System.Security.Cryptography.Algorithms' on net46 by adding that assembly to our NuGet package.

Along with this change, I refactored the nuspec to include all files under the "PackagesLayout" folder, which means we no longer have to duplicate each file.  "Build" just needs to place the file in the correct spot under "PackagesLayout".

Fix #45
mmitche pushed a commit to mmitche/sdk that referenced this issue Jun 5, 2020
Add new capability SupportHierarchyContextSvc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant