MiloszKrajewski/LibZ

Compiling source error signing output

KristjanLaane opened this issue · 5 comments

Just wanted to have a look around, so I cloned the source and opened LibZ.sln with Visual Studio 2015 and hit Build Solution. Seems like there are some fatal errors due to not having the signing file LibZ.snk? How could I compile without errors?

1>------ Build started: Project: LibZ.Bootstrap.40, Configuration: Release Any CPU ------
2>------ Build started: Project: LibZ.Injected.35, Configuration: Release Any CPU ------
3>------ Build started: Project: LibZ.Injected.40, Configuration: Release Any CPU ------
4>------ Build started: Project: LibZ.Bootstrap.35, Configuration: Release Any CPU ------
1>CSC : error CS7027: Error signing output with public key from file '..\..\LibZ.snk' -- File not found.
5>------ Build started: Project: LibZ.Msil, Configuration: Release Any CPU ------
4>  LibZ.Bootstrap.35 -> I:\shisha\LibZ\src\LibZ.Bootstrap.35\bin\Release\LibZ.Bootstrap.dll
4>          1 file(s) copied.
3>  LibZ.Injected.40 -> I:\shisha\LibZ\src\LibZ.Injected.40\bin\Release\LibZ.Injected.dll
3>          1 file(s) copied.
2>  LibZ.Injected.35 -> I:\shisha\LibZ\src\LibZ.Injected.35\bin\Release\LibZ.Injected.dll
6>------ Build started: Project: LibZ.Manager, Configuration: Release Any CPU ------
2>          1 file(s) copied.
6>  LibZ.Manager -> I:\shisha\LibZ\src\LibZ.Manager\bin\Release\LibZ.Manager.dll
7>------ Build started: Project: LibZ.Tool.Interfaces, Configuration: Release Any CPU ------
7>CSC : error CS7027: Error signing output with public key from file '..\..\LibZ.snk' -- File not found.
8>------ Build started: Project: LibZ.Codec.Doboz, Configuration: Release Any CPU ------
5>  Paket version 2.63.3.0
5>  1 second - ready.
5>  LibZ.Msil -> I:\shisha\LibZ\src\LibZ.Msil\bin\Release\LibZ.Msil.dll
9>------ Build started: Project: LibZ.Tool.InjectIL, Configuration: Release Any CPU ------
8>  Paket version 2.63.3.0
8>  packages folder is locked by paket.exe (PID = 12656). Waiting...
8>  1 second - ready.
8>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Tool.Interfaces\bin\Release\LibZ.Tool.Interfaces.dll' could not be found
9>  Paket version 2.63.3.0
9>  1 second - ready.
9>I:\shisha\LibZ\src\LibZ.Tool.InjectIL\Precompiled.resx(126,5): error MSB3103: Invalid Resx file. Could not find file 'I:\shisha\LibZ\src\LibZ.Tool.InjectIL\resources\libz.bootstrap.40.dll'. Line 126, position 5.
10>------ Build started: Project: LibZ.Tool, Configuration: Release Any CPU ------
10>  Paket version 2.63.3.0
10>  0 seconds - ready.
10>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Bootstrap.40\bin\Release\LibZ.Bootstrap.dll' could not be found
10>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Tool.InjectIL\bin\Release\LibZ.Tool.InjectIL.dll' could not be found
10>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Tool.Interfaces\bin\Release\LibZ.Tool.Interfaces.dll' could not be found
11>------ Build started: Project: libz, Configuration: Release Any CPU ------
11>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Bootstrap.40\bin\Release\LibZ.Bootstrap.dll' could not be found
11>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Tool\bin\Release\LibZ.Tool.dll' could not be found
12>------ Build started: Project: LibZ.Codec.LZ4, Configuration: Release Any CPU ------
12>  Paket version 2.63.3.0
12>  0 seconds - ready.
12>CSC : error CS0006: Metadata file 'I:\shisha\LibZ\src\LibZ.Tool.Interfaces\bin\Release\LibZ.Tool.Interfaces.dll' could not be found
========== Build: 5 succeeded, 7 failed, 0 up-to-date, 0 skipped ==========

Yes. I'm not distributing my signing key. Run 'fake.cmd' from 'src' folder and it will do all the things which are needed for build. It will create a random key for you and use it for signing.

Great, this worked on a machine with Visual Studio 2013 installed. But running fake.cmd did not work on a machine wtih Visual Studio 2015 installed. Please find the output appended below. I can manage with VS 2013, so I'm ok but it's not future-proof I guess.
Thanks for amazing work!

No version specified. Downloading latest stable.
Paket.exe 2.63.3 is up to date.
Paket version 2.63.3.0
0 seconds - ready.
'""\vsvars32.bat' is not recognized as an internal or external command,
operable program or batch file.
[more stuff here] ..........
The resulting target order is:
 - KeyGen
 - Version
 - Build
Starting Target: KeyGen
I:\shisha\LibZ\LibZ.snk not found
C:\Program Files (x86)\Microsoft SDKs/Windows/v8.0A/bin/NETFX 4.0 Tools/sn.exe -
k ../LibZ.snk
Running build failed.
Error:
System.Exception: Start of process C:\Program Files (x86)\Microsoft SDKs/Windows
/v8.0A/bin/NETFX 4.0 Tools/sn.exe failed. The system cannot find the file specif
ied
   at Fake.ProcessHelper.ExecProcessWithLambdas@76-16.Invoke(String message) in
C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 76
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartI
nfoF, TimeSpan timeOut, Boolean silent, FSharpFunc`2 errorF, FSharpFunc`2 messag
eF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 76
   at Fake.StrongNamingHelper.StrongName(FSharpFunc`2 setParams, String command)
 in C:\code\fake\src\app\FakeLib\StrongNamingHelper.fs:line 31
   at FSI_0001.Build.clo@62.Invoke(Unit _arg1) in I:\shisha\LibZ\src\build.fsx:l
ine 65
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake
\src\app\FakeLib\TargetHelper.fs:line 483

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
No target was successfully completed
---------------------------------------------------------------------

open fake.cmd and add new line for Visual Studio 2015, I guess it will be "130" (NOTE: I do not have Visual Studio 2015 installed)

hint:

if not "%VS90COMNTOOLS%"=="" set VSTOOLKIT=%VS90COMNTOOLS%
if not "%VS100COMNTOOLS%"=="" set VSTOOLKIT=%VS100COMNTOOLS%
if not "%VS110COMNTOOLS%"=="" set VSTOOLKIT=%VS110COMNTOOLS%
if not "%VS120COMNTOOLS%"=="" set VSTOOLKIT=%VS120COMNTOOLS%
call "%VSTOOLKIT%"\vsvars32.bat

Did it work?

Adding the following line helped a bit:
if not "%VS140COMNTOOLS%"=="" set VSTOOLKIT=%VS140COMNTOOLS%
But the next error is now:

C:\Program Files (x86)\Microsoft SDKs/Windows/v8.0A/bin/NETFX 4.0 Tools/sn.exe -
k ../LibZ.snk
Running build failed.
Error:
System.Exception: Start of process C:\Program Files (x86)\Microsoft SDKs/Windows
/v8.0A/bin/NETFX 4.0 Tools/sn.exe failed. The system cannot find the file specif
ied
   at Fake.ProcessHelper.ExecProcessWithLambdas@76-16.Invoke(String message) in
C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 76
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartI
nfoF, TimeSpan timeOut, Boolean silent, FSharpFunc`2 errorF, FSharpFunc`2 messag
eF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 76
   at Fake.StrongNamingHelper.StrongName(FSharpFunc`2 setParams, String command)
 in C:\code\fake\src\app\FakeLib\StrongNamingHelper.fs:line 31
   at FSI_0001.Build.clo@62.Invoke(Unit _arg1) in I:\shisha\LibZ\src\build.fsx:l
ine 65
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake
\src\app\FakeLib\TargetHelper.fs:line 483

---------------------------------------------------------------------
Build Time Report
---------------------------------------------------------------------
No target was successfully completed
---------------------------------------------------------------------

It is because the folder C:\Program Files (x86)\Microsoft SDKs/Windows/v8.0A does not exist whereas C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools does - not sure how to fix it though ..