简体   繁体   中英

Silverlight XAP Files Not Updating

We run a commercial silverlight application. When we upgrade our site in IIS some of our users need to clear out their browser history to get the latest updates.

This is silly as you can imagine.

If they don't clear out their browser history some of the users get this,

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E; BRI/2)

Timestamp: Thu, 16 Jun 2011 02:41:49 UTC

Message: Unhandled Error in Silverlight Application Unable to retrieve the module type Car.CarList.InitModule, Car.CarList, Version=1.0.123.17153 from the loaded assemblies.  You may need to specify a more fully-qualified type name.   at Microsoft.Practices.Composite.Modularity.ModuleInitializer.HandleModuleInitializationError(ModuleInfo moduleInfo, String assemblyName, Exception exception)

UPDATE: I am starting to understand the issue. Look at the fiddler output,

/ClientBin/Main.xap?ignore-20/06/2011%209:30:19%20a.m.
/ClientBin/CarList.xap

The last-write filedate of the Silverlight Application XAP file has been added to the Main.xap file like explained here,

http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file/

BUT the error above relates to the Car.CarList module which is in a different XAP file.

The problem is that PRISM causes the second 'module' to be loaded CarList.xap, so I am not sure how to add the required query string.

OK, this definitely solved it.

My module catalog loading looked like this,

protected override IModuleCatalog GetModuleCatalog()
{
    var CarListModule = new ModuleInfo()
    {
        ModuleName = "CarList",
        ModuleType = "Car.CarList.InitModule, Car.CarList, Version=1.0.0.0",
        Ref = "CarList.xap",
        InitializationMode = InitializationMode.OnDemand,
    };
    // blah
}

I changed it to this,

protected override IModuleCatalog GetModuleCatalog()
{
    var CarListModule = new ModuleInfo()
    {
        ModuleName = "CarList",
        ModuleType = "Car.CarList.InitModule, Car.CarList, Version=1.0.0.0",
        Ref = "CarList.xap?Version=1.0.0.0",
        InitializationMode = InitializationMode.OnDemand,
    };
    // blah
}

The query string will be different for each release thus forcing it to load the XAP file and not use the cached version.

Our build server finds the text Version=1.0.0.0 above and substitutes the real versions numbers. This includes the version number in the ModuleType text. To correspond the build server also sets the version number in the actual modules to match.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM