Click here to Skip to main content
15,918,742 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to assign Image Source dynamically from a different web application path.

I have tried following code

ImageSourceConverter imgConv = new ImageSourceConverter();
string path = "pack://application:http://upload.wikimedia.org/wikipedia/commons/0/04/Sun_in_the_sky.jpg";
ImageSource imgSrc = (ImageSource)imgConv.ConvertFromString(path);
image1.Source = imgSrc;

Please help me in this.
Posted

1 solution

No, no, applications are different processes (even it this is the same application started again), and the processes are well isolated, they run in separate address spaces. So, you cannot do such things. Instead, you should review your architecture.

For example, you can have shared assembly used as a library supplying images for both applications. In this case, though, you will have two different instances of the same file loaded in memory in two different address spaces, so what? in return, it will work… :-)

Also, think critically if you really want to separate applications. To me, such cases, often quite valid, always look suspicious.

—SA
 
Share this answer
 
v2

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