Reputation: 120
I added a pdf file ("myfile.pdf") with "Add Existing Item ..." to my wpf project. Then I set the properties of it to "Resource" and "Do not Copy" (similar to the properties of other resources that I have, e.g flowdocuments). Then I tried to execute
System.Diagnostics.Process.Start("myfile.pdf")
and obtained a 'file not found' error.
When I change the file properties to "build: content" and "copy if newer" everything works fine. However, I would prefer not to have this file in my output directory.
I work with VisualStudio Community 2013. Is it maybe possible that VisualStudio cannot include a pdf file because it cannot compile it?
Upvotes: 1
Views: 726
Reputation: 359
It's impossible. You can try to write the file from resources to %Temp% and open this File. But you can't control when an external program releases this file and deletes it.
Upvotes: 1