Feature #44
Add version to solid file
| Status: | Closed | Start: | ||
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assigned to: | Cambell Prince | % Done: | 0% |
|
| Category: | application | Spent time: | - | |
| Target version: | V0.08.0 (first working: MAD) | |||
| Resolution: | fixed |
Description
Add version information to the solid file. This will allow future versions to be backward compatible by providing say an XSLT to map from old version to new version.
History
Updated by Cambell Prince over 4 years ago
Something like this (ex WeSay):
public static bool [[MigrateConfigurationXmlIfNeeded]](XPathDocument configurationDoc, string targetPath)
{
Logger.WriteEvent("Checking if migration of configuration is needed.");
if (configurationDoc.CreateNavigator().SelectSingleNode("configuration") == null)
{
Logger.WriteEvent("Migrating Configuration File from version 0 to 1.");
//ResourceManager mgr = new System.Resources.ResourceManager(typeof(WeSay.Project.WeSayWordsProject));
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(WeSayWordsProject),
"MigrateConfig0To1.xsl"))
{
[[XslCompiledTransform]] transform = new [[XslCompiledTransform]]();
using (XmlReader reader = [[XmlReader]].Create(stream))
{
transform.Load(reader);
string tempPath = Path.GetTempFileName();
using (XmlWriter writer = [[XmlWriter]].Create(tempPath))
{
transform.Transform(configurationDoc, writer);
transform.TemporaryFiles.Delete();
writer.Close();
}
string s = targetPath + ".tmp";
if (File.Exists(s))
{
File.Delete(s);
}
File.Move(targetPath, s);
File.Move(tempPath, targetPath);
File.Delete(s);
return true;
}
}
}
return false;
}Updated by Mark - over 4 years ago
- Status changed from New to Closed
- Resolution set to fixed
Fixed in r135