none
Could not find file 'Syncfusion.Diagram.Base.resources' while executing the "(Control)Activator.CreateInstance(type)" code RRS feed

  • Question

  • Hi,

    I am using VS2013 with 4.5.1 framework.

    while deserializing my custom Control application, found the below exception while executing "(Control)Activator.CreateInstance(type)" code.

    image link:

    https://social.msdn.microsoft.com/Forums/getfile/1155577

    Exception Details:

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    Additional information: Could not find file 'Syncfusion.Diagram.Base.resources'.

    plase suggest me on this. 

    Regards,

    Naganathan 





    • Edited by Naga Nathan Wednesday, November 8, 2017 11:46 AM
    Wednesday, November 8, 2017 5:07 AM

All replies

  • Hi Naga Nathan,

    Thank you for posting here.

    >>https://social.msdn.microsoft.com/Forums/getfile/1155577

    The link you provided I could not open.

    According to your description, I am not sure that what cause the error. Could you provide the sample code which could reproduce the error for us to test?

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 9, 2017 10:17 AM
    Moderator
  • HI 

    please find the image in below.

    https://social.msdn.microsoft.com/Forums/getfile/1157690

    code:

     System.Resources.ResourceManager resource = new System.Resources.ResourceManager("Syncfusion.Diagram.Base.Resources.Images", typeof(Resources).Assembly);
                this.btnBold.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
                this.btnBold.Image = ((System.Drawing.Image)(resource.GetObject("Bold")));

    StackTrace details:

    System.IO.FileNotFoundException occurred

      _HResult=-2147024894

      _message=Could not find file 'Syncfusion.Diagram.Base.resources'.

      HResult=-2147024894

      IsTransient=false

      Message=Could not find file 'Syncfusion.Diagram.Base.resources'.

      Source=mscorlib

      StackTrace:

           at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)

      InnerException:

    • Edited by Naga Nathan Monday, November 13, 2017 5:09 AM
    Monday, November 13, 2017 5:00 AM
  • The issue is that you're trying to use a third party library (Syncfusion) in your code and the assembly cannot be found. Hence it throws an exception. The filename you're passing to the resource manager isn't correct possibly. Not sure where you found this code at and since Syncfusion is a third party library I cannot easily provide suggestions. But unless there is a binary file in the same place your EXE is at called *.base.resources then the load will fail. 

    I would recommend that you validate your installation of Syncfusion controls. If you have further problems then you should post your question in their forums. This isn't really an issue with the framework and we don't provide support for third-party libraries in the C# forums.


    Michael Taylor http://www.michaeltaylorp3.net

    Monday, November 13, 2017 3:58 PM
    Moderator
  • Thanks for your reply.

    Is there any other options like ResourceManager?

    Because we are retrieving the images from the Syncfusion diagram's assmblies (i.e. Satellite assembly) by using ResourceManager class. So there is any other options to retrieving the images from the satellite assemblies?

    Tuesday, November 14, 2017 4:34 AM
  • I don't use Syncfusion so I cannot specify exactly what you need to do but based upon the error it looks like you're using the wrong assembly name. Using JustDecompile or equivalent, check the assembly you are already using for the controls. Most likely it has the core resources embedded in it. That is the assembly you'd target. The runtime will then use the current cultural settings to look for a culture-specific resource file automatically. You shouldn't need to do this yourself.

    ResourceManager is the correct approach for loading resources generically. But you should also look to see if they may provide a helper class that already handles this for you. Many control libraries expose a type or 2 to give you more easy access to their resources without the need for ResourceManager. You should probably ask Syncfusion though.


    Michael Taylor http://www.michaeltaylorp3.net

    • Proposed as answer by Fei HuModerator Thursday, November 16, 2017 1:54 AM
    Tuesday, November 14, 2017 4:53 PM
    Moderator