Simultaneously load multiple versions of the same Revit Addin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone !
I was sick of reloading Revit foreach changes in my addins code so I made some kind of "Toolbox addin" which is managing all other addins.
The Toolbox have a refresh button and if there is a change in some of the .dll files of an addin :
- It downloads it,
- Put it in the Temp folder with an unique name,
- Hide the previous pushbutton,
- Create a new pushbutton with the new assemblypath.
If the new version has no link with the old version it works. (By no links I mean files coming from other Visual Studio solutions). Unfortunately when I use a new version of the same addin it seems like Revit is uniquely identifying it by I don't know which way. Because when I click the new created pushbutton : Revit load the old version with no consideration for the assemblypath I gave him.
Here is a sample of the "ToolBox addin" :
if (updateOnTheFly) { foreach (RibbonItem rItem in appItems) { rItem.Enabled = false; //i hide all other old version rItem.Visible = false; } string tempPath = Path.GetTempPath(); tempPath = Path.Combine(tempPath, "SYA_TEMP"); if (!Directory.Exists(tempPath)) { Directory.CreateDirectory(tempPath); } getNewAssembly(tempPath, server); //i get the new dll and decompress it in the temp folder string oldFile = Path.Combine(tempPath, meta.dllName); string tempDllChecksum = calculateChecksum(oldFile); //i compute the hash of the new dll to make his name unique string newName = tempDllChecksum + ".dll"; string newFile = Path.Combine(tempPath, newName); if (!File.Exists(newFile)) { File.Move(oldFile, newFile); //i rename the new file PushButtonData buttonData = new PushButtonData(name + tempDllChecksum, meta.text + "\nnew", newFile, meta.startClassName); //HERE if the "newFile".dll come from the same VS project revit takes the old version for no apparent reason buttonData.ToolTip = meta.tooltip; BitmapImage bi = ConnectOptionsData.base64ToImage(meta.base64Logo); PushButton pushButton = mainPanel.panel.AddItem(buttonData) as PushButton; pushButton.LargeImage = bi; pushButton.Image = bi; } }
If you have already experienced this problem please help !
Thanks anyway !
PS : I know the "attach to process" function of VS but I can't use it because the new .dll is on a distant server !