2

我需要将与我的 Visual Studio 项目链接的文件的文件名作为“资源”、“嵌入式资源”或“内容”(不管哪个)。我怎样才能得到它的绝对或相对路径?问题是我的应用程序在当前目录“C:\Program Files\Microsoft Silverlight”下运行(因为它是 OOB?!),所以我不能只将文件设置为“如果较新则复制”并使用相对于程序集执行目录。

4

1 回答 1

1

A resource embedded in your Silverlight application can't have a relative file path per se.

If you choose embedded resource or resource, the file will be embedded in the project dll as a resource.

If you choose "content", I think (but I am not entirely sure) that the file will be embedded in the XAP file of your Silverlight application.

Either case, it's in the application package (the XAP file) , and therefore isn't really reachable from outside.

于 2011-08-08T19:16:42.813 回答