cancel
Showing results for 
Search instead for 
Did you mean: 

How does PictureButton resource work in .Net Assembly?

Former Member
0 Kudos

Hi,

Does anybody know how PB picturebutton's picture file deploy work in a .Net Assembly dll?

Picture file name is specified in the .Net Assembly project file.  PB (classic) deploys it successfully by generating the dll.  Then add the dll to a C# window form application. 

Run the WinForm application to open PB window with picturebutton control and the picture is shown.  However, if I delete the picture file in the PB resource location, run the WinForm application again and I got System.IO.FileNotFoundException error.

Isn't the picture embedded in the dll and then loading from dll? 

Thanks for any help!

Christine

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You should be able to assign a PBR file in the project similar to how Classic works. That should cause the picture file to be embedded.

Former Member
0 Kudos

HI,

Thanks for reply. I could see the dll with the picture file embedded.  But when I load the assembly in winform application, somehow it could not load the picture.  What would the reason that causes to find the location of the picture file instead of loading from the assembly?

If I place the picture file in the winform application solution bin\debug\, the picture will load.  But I shouldn't need to right?

Thanks,

Christine

Former Member
0 Kudos

Hi Christine;

  The PB Assembly will not derive any external resources from a DLL but only from its own deployed  location. That is because the Assembly feature was built upon the PB 11.0 WebForms feature. In Webforms, all external resources like images are always external entities that must be deployed to the IIs web server deployment location for the server & browser to resolve.

   Because the Assembly .Net compilation uses that same Webforms model mentality - ignoring the PBR - and placing the image files within the "bin\debug\" location you mentioned. So you will have to deploy all your images as independent files to the PB Assemblies location where VS is picking up the Assembly in order for that to work visually.

   The only way this image file restriction could be changed is when Appeon releases their own PB versions and upgrades the .Net Assembly processing model to use the PBR directed DLL(s). 

HTH  

Regards ... Chris