Designer does not recognize resources from sub-projects.

0
0

Dear Team,

From my main “eMain” project I have moved all images to a dependent sub-project “eResources”, so I can better share the images across main projects.

Before the change, the Designer has happily referenced the images using the generated resource property.

this.colDownload.CellImage = global::eMain.Diagona.diagona_icons_190;

During migration, I have manually replaced the references to the sub-project.
And this works correctly.

this.colDownload.CellImage = global::eResources.Diagona.diagona_icons_190;

But the problem now is that the Designer seem not to recognize the resources from sub-projects.
It forcefully embeds the image locally into the form, each time I open the Designer.

this.colDownload.CellImage = ((System.Drawing.Image)(resources.GetObject(“colDownload.CellImage”)));

I wonder if there is a way to persuade the Designer to recognize the sub-projects?

If necessary, I can create a small sample solution.

Regards,

Kizaemon

 

  • You must to post comments
0
0

Hi Kizaemon,

Your only solution would be to use the workaround.

The behavior is the same for WinForms and Wisej.NET, where if you modify the designer code everything would be reserialized and all the changes would be lost or modified.
That’s the reason for the “do not modify the contents of this method with the code editor.* comment there!

HTH,
Alaa

  • You must to post comments
0
0

Hi Frank,

 

thank you very much.

 

A simple project is attached.

Please see Page1 of the eMaster main app.

 

The resources in the eResources library are generated using PublicResXFileCodeGenerator, and so are visible by the referencing libraries.

 

The Select Resource dialog box does not allow selecting images from referenced projects, only from local resources.

As mentioned before, the designer then forcefully embeds the image into local resources.GetObject(…)

Not sure how much efforts there will be to allow the Select Resource dialog box enumerate referenced libraries for resources.

 

For now, as work-around, I put the image assignment manually outside of the designer into Page constructor, just after InitializeComponent.

public Page1()
{
InitializeComponent();
this.pictureBox2.Image = global::eResources.ComputerFile.Computer_File_011;
}

Kizaemon

  • You must to post comments
0
0

Hi Kizaemon,

can you please wrap up a small sample as you suggested. This will speed up the process on our side and we´ll take a closer look at it.

Thanks in advance,
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.