Charles Mager
Guest
|
Hi
I'm using Telerik's WPF controls inside a Word/Excel add-in that I'm writing.
I've wired a button to load a WPF window - which works fine. However, if I use one of Telerik's controls that isn't yet loaded, I get an assembly loading exception. The DLL is in the bin directory, but it seems from the Fusion log below that it is looking for this DLL in Appbase, which is currently the Office directory - it's obviously not there.
I've tried changing Appbase for AppDomain.CurrentDomain, but still the same error.
Any ideas how to resolve this?
Charlie
FusionLog:
=== Pre-bind state information ===
LOG: DisplayName = Telerik.Windows.Controls.Navigation, PublicKeyToken=5803cfa389c90ce7
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Telerik.Windows.Controls.Navigation, PublicKeyToken=5803cfa389c90ce7 | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Office/Office15/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Office/Office15/Telerik.Windows.Controls.Navigation.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Office/Office15/Telerik.Windows.Controls.Navigation/Telerik.Windows.Controls.Navigation.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Office/Office15/Telerik.Windows.Controls.Navigation.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Office/Office15/Telerik.Windows.Controls.Navigation/Telerik.Windows.Controls.Navigation.EXE. |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Charles,
Please make sure that you deploy a correct version of that assembly to the add-in folder on the target machine.
Andrei Smolin
Add-in Express Team Leader |
|
Charles Mager
Guest
|
Hi Andrei
Thanks for the quick response! I'm currently only in the early stages and am only running the add-in in the debugger - I haven't got around to deployment yet.
The correct version of the assembly (I'm fairly sure it is correct!) is present in the bin\Debug folder with the rest of the files, but when the WPF form causes this to be loaded then Fusion is looking for this in file:///C:/Program Files (x86)/Microsoft Office/Office15/ (per the log above). The assembly is obviously not there. The window renders fine at design time. If it makes a difference, the WPF bits are in a separate project that is referenced by the add-in project.
It is a little strange that other Telerik controls that require different DLLs aren't causing the same issue - it's possible these are instantiated at a different time. I'll check it out when I'm back.
Charles |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Charles,
Yet, the assembly isn't found. Probably, this occurs because the PublicKeyToken, culture, etc. of the assembly which is located in that folder differs from those of the assembly used when you develop the add-in.
Is the add-in registered in that folder? (= Do you register it form Visual Studio?) Or, you've installed the add-in to some other folder?
Can it be that you have two (indirect) references to that assembly?
Andrei Smolin
Add-in Express Team Leader |
|
Charles Mager
Guest
|
Hi Andrei
Simply unregistering and registering the add-in (via VS) has fixed the issue. However, I can't explain this.
Could you explain a little around what registering and unregistering is doing and how it might relate to this? Is there any reference material that covers this? I'm a bit new to your product - I'm on day 2!
Thanks
Charles |
|
Andrei Smolin
Add-in Express team
Posts: 19138
Joined: 2006-05-11
|
Hello Charles,
Registering will rebuild your add-in project and create registry keys described in section "Locating COM add-ins in the registry" at http://www.add-in-express.com/docs/net-deploying-addins.php. This should also rebuild the dependency projects. I don't know how can this influence a third-party assembly used in your project.
Andrei Smolin
Add-in Express Team Leader |
|