Building tSQLt project from sources locally (certificate issue)

43 views
Skip to first unread message

Dmitrij Kultasev

unread,
Nov 2, 2020, 8:02:42 AM11/2/20
to ts...@googlegroups.com
Hi,
I'm trying to finish my pull request and can't set the project anymore.
When I try to run the project build, I'm getting following error:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:AnyCPU /errorreport:prompt /define:TRACE /highentropyva- /reference:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorlib.dll /reference:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Transactions.dll /reference:C:\Windows\Microsoft.NET\Framework64\v2.0.50727\System.Xml.dll /debug:pdbonly /optimize+ /out:obj\CruiseControl\tSQLtCLR.dll /target:library /utf8output Annotations.cs AssemblyCopyright.cs AssemblyInfo.cs CommandExecutor.cs CommandExecutorException.cs OutputCaptor.cs tSQLtPrivate.cs InvalidResultSetException.cs MetaDataEqualityAsserter.cs ResultSetFilter.cs StoredProcedures.cs TestDatabaseFacade.cs
     [exec] AssemblyInfo.cs(35,12): warning CS1699: Use command line option '/keycontainer' or appropriate project settings instead of 'System.Reflection.AssemblyKeyNameAttribute' [C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj]
     [exec] CSC : error CS1548: Cryptographic failure while signing assembly 'c:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\obj\CruiseControl\tSQLtCLR.dll' -- 'The key container name 'tSQLt_OfficialSigningKey' does not exist' [C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj]
     [exec] Done Building Project "C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj" (default targets) -- FAILED.
     [exec] 
     [exec] Build FAILED.
     [exec] 
     [exec] "C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj" (default target) (1) ->
     [exec] (CoreCompile target) -> 
     [exec]   AssemblyInfo.cs(35,12): warning CS1699: Use command line option '/keycontainer' or appropriate project settings instead of 'System.Reflection.AssemblyKeyNameAttribute' [C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj]
     [exec] 
     [exec] 
     [exec] "C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj" (default target) (1) ->
     [exec] (CoreCompile target) -> 
     [exec]   CSC : error CS1548: Cryptographic failure while signing assembly 'c:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\obj\CruiseControl\tSQLtCLR.dll' -- 'The key container name 'tSQLt_OfficialSigningKey' does not exist' [C:\Users\dkult\OneDrive\Docs\Sources\tSQLt-1\tSQLtCLR\tSQLtCLR\tSQLtCLR.csproj]
     [exec] 
     [exec]     1 Warning(s)
     [exec]     1 Error(s)
I created certificate with no password:
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
"C:\Program Files\OpenSSL-Win64\bin\openssl.exe" pkcs12 -inkey key.pem -in cert.pem -export -out tSQLtOfficialSigningKey.pfx
Then I copied tSQLtOfficialSigningKey.pfx file to tSQLtCLR\OfficialSigningKey. Tried to run Import-PfxCert.ps1 (seems that it passed, but probably this step isn't needed) and also executed InstallSigningKey.bat file (it asked for password)

Liz Baron

unread,
Nov 6, 2020, 5:39:35 AM11/6/20
to tSQLt
Hi Dmitrij,

You aren't the first one to struggle with this. Sebastian and I are going to try to figure out a way to automate it and get back to you.

--Liz

Dmitrij Kultasev

unread,
Nov 6, 2020, 5:54:17 AM11/6/20
to ts...@googlegroups.com
I found my problem already. Can write step by step instructions of needed

пт, 6 нояб. 2020 г., 12:39 Liz Baron <lizb...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "tSQLt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tsqlt+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tsqlt/12f0ad2f-10d9-4d12-9975-503aa7c4ea90n%40googlegroups.com.

Liz Baron

unread,
Nov 6, 2020, 6:12:52 AM11/6/20
to ts...@googlegroups.com
Congratulations, Dmitrij! I'm happy to hear that.

It would be great if you could write up the instructions or create a Powershell script.

Going forward we think it should be a simple script that others can run locally from tSQLt/tSQLtCLR/OfficialSigningKey/createTempSigningKey.ps1. If you'd also like to submit that pull request, it would be welcome!

--Liz

Dmitrij Kultasev

unread,
Nov 6, 2020, 12:23:31 PM11/6/20
to ts...@googlegroups.com
I'll do, after I finish with active PR, now I'm finally unlocked

пт, 6 нояб. 2020 г., 13:12 Liz Baron <lizb...@gmail.com>:

Dmitrij Kultasev

unread,
Nov 15, 2020, 9:42:40 AM11/15/20
to ts...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages