TysonMay / monoxna

Automatically exported from code.google.com/p/monoxna
0 stars 0 forks source link

Fake the MS Public Key #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Trying to start a game which uses Xna fails already at the loading stage:

---
** ([...]:21621): WARNING **: The following assembly referenced from [...] 
could not be loaded:
     Assembly:   Microsoft.Xna.Framework.Game    (assemblyref_index=3)
     Version:    3.1.0.0
     Public Key: 6d5c3888ef60e27d
The assembly was not found in the Global Assembly Cache, a path listed in the 
MONO_PATH environment variable, or in the location of the executing assembly 
([...]).

** ([...]): WARNING **: Could not load file or assembly 
'Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, 
PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies.

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or 
assembly 'Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, 
PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies.
File name: 'Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, 
PublicKeyToken=6d5c3888ef60e27d'

---

Reason is that the public key does not match:
/usr/lib64/mono/gac/Microsoft.Xna.Framework/3.1.0.0__1c633ed318da3899/Microsoft.
Xna.Framework.dll

According to irc.gimp.net#mono the key can be faked. This is what Mono 
internally does for the core part of .NET.

Original issue reported on code.google.com by devuran...@gmx.net on 19 Sep 2010 at 5:32

GoogleCodeExporter commented 8 years ago
This should already be working, or at least timpambor has submitted a patch for 
it to the mono-project. He's the one to talk to about this.

Original comment by lav...@gmail.com on 22 Sep 2010 at 4:58

GoogleCodeExporter commented 8 years ago
It seems to be working for me:

$ gacutil2 -l|grep Xna
Microsoft.Xna.Framework, Version=3.1.0.0, Culture=neutral, 
PublicKeyToken=6d5c3888ef60e27d
Microsoft.Xna.Framework.Game, Version=3.1.0.0, Culture=neutral, 
PublicKeyToken=6d5c3888ef60e27d

I had to add a map entry to machine.config and then I signed both dll's with 
src/Microsoft.Xna.Framework/Microsoft.Xna.snk.  After that I used gacutil2 -i 
to install the dll's into the GAC.

The final test was to run a game built on Windows in a separate directory, and 
make sure it would use the assemblies in the GAC, and this worked as well.

Original comment by jljus...@gmail.com on 10 Jun 2011 at 3:27

GoogleCodeExporter commented 8 years ago
What version of Mono are you running?

Original comment by lav...@gmail.com on 10 Jun 2011 at 6:30