xaudio2's picture

Support for signed assembly

Project:The Open Toolkit library
Version:0.9.9-2b
Component:Code
Category:task
Priority:critical
Assigned:the Fiddler
Status:closed
Description

At present it isn't possible to use the library in signed programs (openTK is not signed, unfortunately).
My attempts to generate such a version of openTK from the source code are ending or with errors during the compilation, or with errors in the runtime process.

Comments

the Fiddler's picture

#1

What kind of errors did you encounter? How did you try to sign the assembly?

If you are using Visual Studio, simply generate the OpenTK solution (Build/Build.exe vs) and use the VS GUI to sign the assembly (Project Properties -> Signing).

We are looking into signing future OpenTK releases.

As a sidenote, Microsoft does not recommend signing exe assemblies to avoid the issues you have encountered:

" In general, you should avoid strong-naming application EXE assemblies. A strongly named application or component cannot reference a weak-named component. Therefore, strong-naming an EXE prevents the EXE from referencing weak-named DLLs that are deployed with the application.

For this reason, the Visual Studio project system does not strong-name application EXEs. Instead, it strong-names the Application manifest, which internally points to the weak-named application EXE. "

xaudio2's picture

#2

Today I solve a problem and sign the library.
My application works correctly with signed openTK 0.9.1!

In relation to exe files I will agree. But OpenTK is a library and should cooperate correctly with any application.
It is only possible when library is signed (All libraries of the mentioned above company are signed :) )

the Fiddler's picture

#3

I agree that OpenTK should ship signed assemblies. The only thing holding this back is lacking msbuild support on Mono (xbuild cannot currently build OpenTK).

the Fiddler's picture

#4

Assigned to:Anonymous» the Fiddler
Status:open» confirmed
the Fiddler's picture

#5

Priority:normal» critical

Bumping priority.

the Fiddler's picture

#6

Title:support for signed assembly» Support for signed assembly
Category:support request» task
the Fiddler's picture

#7

Status:confirmed» in progress

I have added strong names to my working copy of OpenTK trunk. Still need to update Build.exe to generate temporary key-pairs on fresh SVN checkouts.

Does anyone know whether it is possible to generate key-pairs programmatically? In the worst case, this can be done by invoking Sn.exe but it would be slightly nicer to do this through code, if possible.

the Fiddler's picture

#8

Status:in progress» fixed

Fixed in rev. 2217. All official releases starting from 0.9.9-2 will be signed.

If you wish to sign a modified version of OpenTK, add a file named 'OpenTK.snk' to the root directory of OpenTK and recreate OpenTK.sln using Build.exe. Rebuild OpenTK - it will now be signed with your custom key.

If 'OpenTK.snk' is not found, OpenTK binaries will not be signed.

If you are distributing a modified version of OpenTK, you are encouraged to sign it with your personal key (use the same key for OpenTK and your application).

You can create a new keyfile using the sn utility that comes with the .Net framework:

sn -k OpenTK.snk
the Fiddler's picture

#9

Version:0.9.x-dev» 0.9.9-2b
Status:fixed» closed

Closing issues fixed in 0.9.9-2.