Page 1 of 1
Help! Several machines, single GUI...
Posted: Fri Mar 27, 2015 10:23 pm
by IXix
I have project configurations to build different versions of my patchbay machine with varying numbers of parameters: IX PatchBay 3.0 12x4.dll, IX PatchBay 3.0 16x8.dll and IX PatchBay 3.0 24x2.dll. It works great for the machine dlls but I can't figure out how to automatically build the relevant GUI dll with the correct name. There doesn't seem to be a way to change the Assembly Name property by configuration.
I tried using the GUI properties post-build event to copy the dll to a new file with the right name but only one of them works. The other two give me this this error...
Any idea how I can make this work? I'll be adding several machine variations so I don't want to have to create a GUI project for each of them when it's exactly the same code. What does the error mean and is there any way I can build the GUI.dll conditionally by via the project configuration to fix it? Or is there any way to force the various machine dlls to use a single core GUI.dll?
Please help! I'm using VS2010.
Re: Help! Several machines, single GUI...
Posted: Sat Mar 28, 2015 10:06 am
by IXix
Hmmm, well in the light of a new day a batch rebuild seems to have fixed it. All three versions work properly now. Maybe it was because I did a batch build last night instead of a batch rebuild and something wasn't changed that should have been. I'll have to be wary of that in future but for now...

Re: Help! Several machines, single GUI...
Posted: Sat Mar 28, 2015 2:26 pm
by thOke

- thumbs_up_smiley.gif (762 Bytes) Viewed 10999 times
Re: Help! Several machines, single GUI...
Posted: Tue Sep 01, 2015 10:03 am
by IXix
Nope, it's still there.
I copied "IX PatchBay 3.0.GUI.dll" to three new files named according to the number of inputs and outputs, ie. "IX PatchBay 3.0 12x4.GUI.dll"
At first it seems that everything works fine. I can create instances of the various machines and the GUI opens fine but at some point I'll create an instance and opening the parameter window throws the exception:
Message=The component 'GUI.PatchbayGUI' does not have a resource identified by the URI '/IX Patchbay 3.0.GUI;component/ix%20patchbay%203.0.gui..xaml'.
Source=PresentationFramework
StackTrace:
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at GUI.PatchbayGUI.InitializeComponent()
at GUI.PatchbayGUI..ctor()
at GUI.MachineGUIFactory.CreateGUI(IMachineGUIHost host)
It looks like loading the same dll with a different name causes a resource id conflict with the previously loaded dlls. The exception happens in this auto-generated function...
Code: Select all
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/IX Patchbay 3.0.GUI;component/ix%20patchbay%203.0.gui..xaml", System.UriKind.Relative); // DO I NEED TO GENERATE THIS STRING AT RUNTIME?
#line 1 "..\..\IX Patchbay 3.0.GUI..xaml"
System.Windows.Application.LoadComponent(this, resourceLocater); // EXCEPTION THROWN HERE
#line default
#line hidden
}
I found a
related thread on stackoverflow but it's a slightly different problem and I don't understand it well enough to adapt the workaround for my situation.
A professional opinion could save me hours of stab-in-the-dark coding. Could I sidestep the issue by loading the xaml from a file instead of embedding it as a resource?
HELP!
Re: Help! Several machines, single GUI...
Posted: Wed Oct 14, 2015 1:28 pm
by IXix
Re: Help! Several machines, single GUI...
Posted: Thu Oct 15, 2015 9:17 pm
by AndersBrontosaurus