开发者

How do I set a resource file to non-embedded

开发者 https://www.devze.com 2022-12-26 21:14 出处:网络
In Visual studio 2008 is it possible to have a resource file that is included as a separate file after compilation rather than as an embedded resource.This is to enable small changes to be rolled out

In Visual studio 2008 is it possible to have a resource file that is included as a separate file after compilation rather than as an embedded resource. This is to enable small changes to be rolled out more easily.

I have tried build options of Resource, None, Compile and also copy local on and off for most of these. However when ever I try access the resource at run time I get a cannot find resource exception.

Is this actually possible or am I wasting my ti开发者_高级运维me?


How are trying to access this resource? If you set the copy local to true you could read it as a simple file:

var contents = File.ReadAllBytes("somefile");
  • Build Action: Content
  • Copy to Output Directory: Copy always or Copy if newer


Try Content option. With this option the file is not compiled, but is included in the Content output group

Take a look on File Properties

0

精彩评论

暂无评论...
验证码 换一张
取 消