我正在将C#应用程序更新到.NET 4.0。较旧的应用程序使用多个第三方DLL,需要从版本2509.0.0.0
升级到3396.0.0.0
。
在旧版应用程序中,app.config文件包含以下几种节点:
<configSections>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" />
</configSections>
.
.
.
<cachingConfiguration defaultCacheManager="Users">
<cacheManagers>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="100000" numberToRemoveWhenScavenging="0" backingStoreName="Isolated Storage" name="SendQueues" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="ServiceUrls" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="10" numberToRemoveWhenScavenging="1" backingStoreName="Null Storage" name="MonitorData" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="10" numberToRemoveWhenScavenging="1" backingStoreName="Null Storage" name="Shipments" />
<add expirationPollFrequencyInSeconds="5" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Tag Collection Storage" name="TagCollections" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="UserIsolatedStorage" name="Users" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="WebProxyIsolatedStorage" name="WebProxy" />
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="0" backingStoreName="InterfaceMapIsolatedStorage" name="InterfaceMap"/>
<add expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="RememberMeIsolatedStorage" name="RememberMe" />
</cacheManagers>
<backingStores>
<add partitionName="WebProxy" encryptionProviderName="WebProxyEncryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="WebProxyIsolatedStorage" />
<add partitionName="SendQueues" encryptionProviderName="SendQueues Encryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Isolated Storage" />
<add partitionName="TagCollections" encryptionProviderName="Tags Cache Encryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Tag Collection Storage" />
<add partitionName="User" encryptionProviderName="Symmetric Storage Encryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="UserIsolatedStorage" />
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Null Storage" />
<add partitionName="RememberMe" encryptionProviderName="Remember me Storage Encryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="RememberMeIsolatedStorage" />
<add partitionName="InterfaceMap" encryptionProviderName="InterfaceMap Encryption" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.IsolatedStorageBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="InterfaceMapIsolatedStorage"/>
</backingStores>
<encryptionProviders>
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="WebProxyEncryption" />
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="SendQueues Encryption" />
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Tags Cache Encryption" />
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Symmetric Storage Encryption" />
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="Remember me Storage Encryption" />
<add symmetricInstance="DPAPI Symmetric Cryptography Provider" type="Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.SymmetricStorageEncryptionProvider, Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography, Version=2509.0.0.0, Culture=neutral, PublicKeyToken=ecdd5b3dfcfef3bb" name="InterfaceMap Encryption"/>
</encryptionProviders>
请注意,引用了许多版本号为2509.0.0.0
的DLL。我有每个DLL的版本3396.0.0.0
。在app.config文件中修改2509.0.0.0
到3396.0.0.0
的所有版本号很有诱惑力,但我认为这不是正确的方法。
该应用程序的旧版本是由其他人开发的。他们是如何生成这样的app.config文件的?如何在app.config文件中为所有这些DLL的版本3396.0.0.0
生成必要的节点?
答案 0 :(得分:0)
我已经差不多2年没有使用.NET了,但是我还记得,有两种方法可以让你的愿望成真:)