Could not load file or assembly Project.Resources

I am trying to use the SFDataGrid, and I have installed the Essential Studio Winforms. 

I have been able to run the sample projects, but when I add the grid to my own project I get the below exception in the InitializeComponent on this line (this.sfDataGrid1 = new Syncfusion.WinForms.DataGrid.SfDataGrid();).

I have compared my project in depth to the sample, and the only real difference is that it is running .net 4.8. I also tried setting my project to 4.6, and that did not help either.

The exception:

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'AppNameRedacted.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  StackTrace:
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)

  This exception was originally thrown at this call stack:
    System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(string, System.Globalization.CultureInfo, System.Version, bool, ref System.Threading.StackCrawlMark)

4 Replies

TI Tim May 12, 2022 05:59 PM UTC

I am using version 20.1.0.47 with Visual Studio 2022. I also have tried creating a project using the SyncFusion project template with the same results.



TI Tim May 12, 2022 08:04 PM UTC

Turns out I found the cause. I had turned on break on ALL exceptions. When this is on, the code breaks loading any SF control.



DM Dhanasekar Mohanraj Syncfusion Team May 13, 2022 02:25 PM UTC

Hi Tim,

We regret to let you know that we are little unclear about the reported scenario. Based on your last update did you resolved the reported issue in our end. If you still facing the reported issue, please share the below mentioned details,

  1. Issue reproducing sample (If possible).
  2. Video illustration for the reported issue.
  3. Founded root cause in your end (Exception settings)

It will be helpful for us to understand the exact problem and to provide you a prompt solution at the earliest.

Regards,
Dhanasekar M.



?? ?? August 19, 2022 05:15 AM UTC

I have the same problems here, using vs2022 and 20.2.0.36. Then I found the issue comes from the localization: https://help.syncfusion.com/windowsforms/form/localization


Add the new resource file to project and replace the one on github resolve this issue:
https://github.com/syncfusion/winforms-controls-localization-resx-files

(e.g. add`Syncfusion.SfDataGrid.WinForms.resx` if the program needs to instantiate 

SfDataGrid)


p.s. if you skip this step, the programs still can run, but will prompt exception on debugger everytimes at program start (or try to ignore this error on vs setting)


Loader.
Up arrow icon