F
fjlaga
I have written an Office Add-in for Excel using VB.NET and the .NET
1.1 Framework (I have Visual Studio 2003 .NET ). All works great. I
want to add a User Settings/Prefereneces dialog and allow the user to
specify some settings and I need to persist these settings between
runs. I made a serializable class which uses the BinaryFormatter to
serialize/deserialize the setttings.
Serialization works great. However, when I try to deserialize the
saved settings on subsequent runs the following exception is thrown:
MyAddin.OnConnection Exception: Cannot find the assembly MyAddin,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null.
at
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
...
To get around this, it seems I need to register my assembly in the
GAC. So, I generated a key pair using the following command:
C:> sn -k "D:\MyAddin\SNKey.snk"
and added the following line to my AssemblyInfo.vb file:
<Assembly: AssemblyKeyFile("D:\MyAddin\SNKey.snk")>
When I try to build with this I get the error:
Unable to emit assembly: Referenced assembly
'Interop.Microsoft.Office.Core' does not have a strong name
I'm confused about how to get this to work. I just want to read and
write my user settings to disk.
Any help is greatly appreciated.
-Frank
1.1 Framework (I have Visual Studio 2003 .NET ). All works great. I
want to add a User Settings/Prefereneces dialog and allow the user to
specify some settings and I need to persist these settings between
runs. I made a serializable class which uses the BinaryFormatter to
serialize/deserialize the setttings.
Serialization works great. However, when I try to deserialize the
saved settings on subsequent runs the following exception is thrown:
MyAddin.OnConnection Exception: Cannot find the assembly MyAddin,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=null.
at
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
...
To get around this, it seems I need to register my assembly in the
GAC. So, I generated a key pair using the following command:
C:> sn -k "D:\MyAddin\SNKey.snk"
and added the following line to my AssemblyInfo.vb file:
<Assembly: AssemblyKeyFile("D:\MyAddin\SNKey.snk")>
When I try to build with this I get the error:
Unable to emit assembly: Referenced assembly
'Interop.Microsoft.Office.Core' does not have a strong name
I'm confused about how to get this to work. I just want to read and
write my user settings to disk.
Any help is greatly appreciated.
-Frank