Error when running the quickstarts

Topics: Updater Application Block
Jan 4, 2005 at 8:46 AM
originally posted by: mtavares

When I try to run the simpleappstart quickstart project, I get the following error:

The located assembly's manifest definition with name 'Microsoft.ApplicationBlocks.Updater' does not match the assembly reference.

I've stepped through to where the exception occurs, and the line is in the ApplicationConfiguation.cs file:

ApplicationUpdaterSettings appSettings = (ApplicationUpdaterSettings)ConfigurationManager.GetCurrentContext().GetConfig( "UpdaterConfiguration" );

For some reason when I do a quickwatch on the GetConfig method, It says that the arguments do not match the parameters for the function.

I'm guessing it may have to do with the EnterpriseLibrary, where maybe I have the wrong version or something, but I'm using the enterprise library files packaged with this v2 release.

Any ideas as to what I'm doing wroing?

Thanks,
Mike
Jan 4, 2005 at 9:23 AM
originally posted by: MHildebrand

I've run into the same problem. I think the Manifest needs to be rebuilt. I'm trying to build the Manifest Utility under v2, however IValidator seems to be missing.
Jan 4, 2005 at 9:36 AM
originally posted by: mtavares

I'm not entirely sure that that's where the problem lies. when I stepped through, it seems to be bombing trying to read the app.config, not the manifest file. That GetConfig function in the enterprise library is returning an error where the "UpdaterConfiguration" string argument does not match the parameter for the function.
Jan 4, 2005 at 9:56 AM
originally posted by: MHildebrand

I see what you mean... On this line :
ApplicationUpdaterSettings appSettings = (ApplicationUpdaterSettings)ConfigurationManager.GetCurrentContext().GetConfig( "UpdaterConfiguration" );
Jan 4, 2005 at 10:00 AM
originally posted by: MHildebrand

I see what you mean... On this line :
ApplicationUpdaterSettings appSettings = (ApplicationUpdaterSettings)ConfigurationManager.GetCurrentContext().GetConfig( "UpdaterConfiguration" );

I tried rnaming the 'SimpleAppStart.exe.config' to 'AppStart.exe.config', but it did little good...
Jan 4, 2005 at 10:41 AM
originally posted by: MHildebrand

The is when reading this file 'updaterconfiguration.config' in the directory
"C:\SourceCode\UAB 20\V2\QuickStarts\cs\SimpleAppStart\Client\SimpleAppStart".

Perhaps the publickey is incorrect in this file?
Jan 4, 2005 at 12:42 PM
originally posted by: nyajaman

Hi Michael,
EnterpriseLibrary is looking for the fully qualified name of the assembly "Microsoft.ApplicationBlocks.Updater" as specified in the "UpdaterConfiguration.config" file. You can change the type attribute value in the "UpdaterConfiguration.config" file to

Before:
<xmlSerializerSection type="Microsoft.ApplicationBlocks.Updater.ApplicationUpdaterSettings, Microsoft.ApplicationBlocks.Updater, Version=2.0.0.0, Culture=neutral, PublicKeyToken=9ac5663a7cbce5e5">
...
</xmlSerializerSection>

Change To:
<xmlSerializerSection type="Microsoft.ApplicationBlocks.Updater.ApplicationUpdaterSettings, Microsoft.ApplicationBlocks.Updater">
...
</xmlSerializationSection>

or you could also change the PublicKeyToken value to take care of the issue.

This will take care of the issue you are running into.

Thanks,
Naveen
Jan 4, 2005 at 2:22 PM
originally posted by: MHildebrand

Naveen:

Thanks - works.

What was happening?

Michael
Jan 5, 2005 at 11:07 AM
originally posted by: nyajaman

You created the key and that has a different public key token than the one found in the .config file. Enterprise Library config block was trying to load the assembly using the Fully Qualified name with the public key token that did not match assembly's public key token. Hence was failing.

Thanks.
Jan 7, 2005 at 1:10 PM
originally posted by: Taniwha

>> You created the key and that has a different public key token than the one found in the .config file
Having only followed the instruction on how to install the apps, at what time did "I Create" the different Public key?


>> or you could also change the PublicKeyToken value to take care of the issue.
How do I establish the value I should change the PublicKeyToken to?

__Allan
Jan 8, 2005 at 3:54 AM
originally posted by: MFrisk

You created a new public key when you ran the sn.exe command. Each UAB assembly contains a file called GlobalAssemblyInfo.cs which references the newly created strong name key combination. When you run one of the QuickStart apps which tries to load one of the UAB assemblies, the PublicKeyToken of the assembly you just built will not match the token specified in the configuration file and the assembly won't load properly.

To create a new PublicKeyToken you can run the sn.exe program aginst the newly generated Microsoft.ApplicationBlocks.Updater.snk file:

sn -tp Microsoft.ApplicationBlocks.Updater.snk

The public key and the public key token will be displayed. Copy the public key token and replace the token in the configuration file.