embedded-resource

Mono .EXE assembly set explorer icon

别来无恙 提交于 2019-11-28 06:53:24
问题 When compiling with gmcs on Linux, how can I set the explorer icon the final EXE will use? I have a .ico file to attach to the output exe. The answer must be build-automatable and execute on Linux (w/o wine -- build machine architecture is not x86). GCC and binutils targeting Windows x86 are available. If you give the answer referring to their short (non-cross) names I'll be able to figure out their cross names easily enough. 回答1: Looks like it is done the same way as .Net (learned from

How to use shared resource file between projects in one solution?

折月煮酒 提交于 2019-11-28 06:28:04
I have a problem with resource files. I have a solution with two projects. The first project contains ImageResource.resx file with the images that I use. Every Form in this project can access this file from the designer. But I can see in the designer ImageResource.resx file to use it from second project ( Reference to second project is present ). I have added the ImageResource.resx file as a link to my second project. And I saw it in the designer! But when I use an image from this resource in the second project Visual Studio modified my original file (It sets the namespaces, and other..) and

MissingManifestResourceException when running tests after building with MSBuild (.mresource has path in manifest)

别说谁变了你拦得住时间么 提交于 2019-11-28 05:29:33
问题 I am having a problem with embedded resources for a C# project on a build server using MSBuild on the command line. The project works just fine when building and running tests in Visual Studio, but when running MSBuild from the command line I get the following problems when running a test: System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure ".Properties.Resources.resources" was correctly

How To Write To An Embedded Resource?

心已入冬 提交于 2019-11-28 05:29:17
问题 I keep getting the error "Stream was not writable" whenever I try to execute the following code. I understand that there's still a reference to the stream in memory, but I don't know how to solve the problem. The two blocks of code are called in sequential order. I think the second one might be a function call or two deeper in the call stack, but I don't think this should matter, since I have "using" statements in the first block that should clean up the streams automatically. I'm sure this

What's the difference between a Resource and an Embedded Resource in a C# application?

寵の児 提交于 2019-11-28 05:09:55
When should I use one or the other? I'd like all of the files I use in my app (images, sound, xml file, etc.) to be inside of the .exe file so I don't deploy with a bunch of folders and files. Thanks for the info. viky “Resource” and “Content” build actions are to access the WPF resources using the Uris. However “Embedded Resource” is for prior technologies. However both options embed the resource in assembly but “Resource” option to be used for WPF. MSDN provides full explanation here . Kent Boogaart A WPF resource (build action = Resource ) leverages embedded resources as supported by the

Can I modify the content of an embedded resource (text/xml file) in a .NET application

你离开我真会死。 提交于 2019-11-28 05:08:17
问题 The title is pretty much the question :-) I've embedded an xml file and a txt file as resources in my .NET app. Am still debugging other things, so cannot run and test this. So just asking, would I be able to modify these files at runtime, after deployment? 回答1: Nope. An embedded resource is a set of bytes in the assembly. Its like trying to modify the code in your assembly, after compiling. This would be doubly bad if your assembly has been signed. If you're trying to swap resources in and

java getResource() not working

早过忘川 提交于 2019-11-28 04:48:46
问题 this is driving me crazy. I have a NetBeans project in a folder with the following structure: MyProject ---- build ---- src ---- resources in src my code is in packages. What I am trying to do is to use getClass().getResource("/resources/new.png"); from a class in package com.my.package but it just refuses to work! The "new.png" image is in the resources folder. Am I missing something here? After a lot of playing around and moving the "new.png" image here and there to see when it will find

How to reference embedded images from CSS?

廉价感情. 提交于 2019-11-28 04:41:02
I have a CSS file that is embedded in my assembly. I need to set a background image for certain elements using this CSS file, and the image needs to be an embedded resource also. Is this possible? Is there any way I can reliably do this? I ran into the problem when putting an existing stylesheet into this dll then realized images weren't showing up. I don't know of any way to make it work though because I would need to know the URL to the embedded image. Has anyone done anything like this? <% = WebResource("image1.jpg") %> You can use above statement inside your CSS file, and while you

Embed resources (eg, shader code; images) into executable/library with CMake

耗尽温柔 提交于 2019-11-28 04:22:36
I am writing an application in C++ which relies on various resources in my project. Right now, I have the relative path from the produced executable to each resource hard-coded in my sources, and that allows my program to open the files and read in the data in each resource. This works ok, but it requires that I start the executable from a specific path relative to the resources. So if I try to start my executable from anywhere else, it fails to open the files and cannot proceed. Is there a portable way to have CMake embed my resources into the executables (or libraries) such that I can simply

How to read a text file inside a JAR? [duplicate]

為{幸葍}努か 提交于 2019-11-28 03:44:34
问题 This question already has an answer here: Java resource as file 6 answers What I am attempting to do is store a text file (that won't change) inside the JAR of the program so that it can be read. The purpose of the text file is that it will be read in by one of my classes and the contents of the text file will be added to an JEditorPane . The file will basically be a tutorial and when the user clicks on the option to read the tutorial, the file contents will be read and displayed in a new