Is it possible to sign a class library netcore dll?
I created a simple net core class library project with the following code:
public class Test
{
public static string TestMethod(string test)
{
return "Hello " + test+ "!";
}
}
I went to project properties, tab signing, checked the "Sign the assembly" option and selected a pfx file.
Built the project and everything was ok.
I then created a net core console application project with the following code:
static void Main(string[] args)
{
Console.WriteLine("Start...");
try
{
string s = Test.TestMethod("123");
Console.WriteLine("Retrieved: " + s);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
To reference the project I added the project as a reference. Left click, add reference, projects and selected the project. When executing in the IDE everything works fine.
I then want to build my exe, so I go to the csproj and add the following line:
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
Then I do
dotnet restore
Everything is Ok, and then:
dotnet build
But it fails here with the error:
error : PFX signing not supported on .NET Core
Is it possible to sign a net core dll? If so what am I doing wrong?