0

I have a project-folder called TestA, then a folder in it called TestB and in that one a folder with the name TestC. In TestC is an image (Image.png) and i want to know how to get that uri.

I need to call a function and give the Uri to the function

I already tried many things like:

Class.Function(new Uri("pack://application:,,,/TestB/TestC/Image.png"));

But I always get this Exception:

Assembly.GetEntryAssembly() returns null.

I am pretty sure, that this part isn´t correct: "pack://application:,,,/TestB/TestC/Image.png"

Thanks for any suggestions :)

Jaydip Jadhav
  • 12,179
  • 6
  • 24
  • 40
  • Does this happen when you are running a unit test? When you do that `Assembly.GetEntryAssembly()` will return null. – Martin Liversage Jan 21 '16 at 07:50
  • It happens in the function Application.GetResourceStream(uri); – chris94 Jan 21 '16 at 07:55
  • possible duplicate http://stackoverflow.com/questions/16409819/pack-uri-to-image-embedded-in-a-resx-file – ymz Jan 21 '16 at 07:58
  • I already found that post, but what how would be the syntax for the Uri in my example then? new Uri("pack://application:,,,/TestA;component/TestB/TestC/images.png")? – chris94 Jan 21 '16 at 08:13
  • Okay... I think the problem is, that the main application is no wpf application :/ – chris94 Jan 21 '16 at 08:55

0 Answers0