Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hi all,

Ok, in fact my primary issue is that how can I loading any UserContols as DLL on a main project as the host by selecting them in runtime?! so please you see MyProject[^] that I've used SelfContainedAssembly[^] project, actually I changed it to a wpf project, but I got the problem and showing this error Could not load file or assembly 'WpfUserControls.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Please may you solve my project, and also you can see this How to adding a new UserControl in runtime[^] that its related with this post.
if my problem is ambiguous and someone understand it, please edit this post to more understanding.

Thanks in advance.
Posted
Updated 21-Nov-11 5:26am
v6
Comments
Sander Rossel 20-Nov-11 16:54pm    
Please no offsite downloads!
Mark Salsbery 21-Nov-11 14:29pm    
Is the assembly really named "WpfUserControls.resources"? How are you trying to do this? Using Application.LoadComponent?
hzawary 21-Nov-11 16:00pm    
Sorry I've updated the code slightly, its ManyWpfControlLibrary, please you receive the MyProject to see program completly.

1 solution

I've had this error a couple of times. I did not check your project, but your problem may be the .NET version.
Make sure you are not using the Client Profile version of your .NET version.
Go to your project settings and go to the tab Compile. Click the "Advanced Compile Options" button in the lower left corner of the tab. Make sure your Target Framework is not set to Client Profile.
Another issue could be that you have not build the project you are referencing. Or perhaps you have build x86, but are referencing Any CPU. Make sure your reference is actually referencing the correct file on disk.
Hope it helps! :)
 
Share this answer
 
Comments
hzawary 21-Nov-11 5:43am    
Thanks Naerling, but project is correct when I've used UserControl Class or StackPanel class, only when I've used an UserControl project, its show the error! please test project me.
Sander Rossel 21-Nov-11 13:27pm    
Are you sure all your projects have the correct Target Framework? If that's not the case it's a little bit hard to tell what's wrong without more information...
Rob Philpott 21-Nov-11 6:09am    
That .NET4 Client Profile thing is a pain. Just saying.
hzawary 21-Nov-11 6:15am    
I checked it and I do it too, but same the error!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900