embedded-resource

Could not find any resources appropriate for the specified culture or the neutral culture

不打扰是莪最后的温柔 提交于 2019-11-26 23:51:32
I have two ASP.NET Web projects (ProjectA and ProjectB). When class in ProjectA is instantiating a class of ProjectB which uses a resource file Blah.resx, I get this error: An exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll but was not handled in user code. Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resources.Blah.resources" was correctly embedded or linked into assembly "App_GlobalResources.sn_flri6" at compile time, or that all the satellite assemblies required are loadable and fully

Application.GetResourceStream called on a Content Resource still return null

我怕爱的太早我们不能终老 提交于 2019-11-26 23:21:23
问题 Here is the task-related part of the VS2010 project (Windows Phone) structure: The code is being executed from DummyMediaLibProvider.cs: public class DummyMediaLibProvider: IMediaLibProvider { ... StreamResourceInfo albumArtPlaceholder = Application.GetResourceStream( new Uri("../Images/artwork.placeholder.png", UriKind.Relative)); artwork.placeholder.png Build Action is set to Content . Still, whenever I run the code, Application.GetResourceStream returns null. What may be the reason for the

Background image for a jPanel not working

ⅰ亾dé卋堺 提交于 2019-11-26 23:08:07
I am new to making GUIs so I decided to try the the windows builder for eclipse, and while great I do have some doubts. I have been searching but I cannot seen to find a good way to add a background image to my "menu". For example I tried this: public Menu() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(50, 50, 300, 250); //Dimensiones contentPane = new JPanel() { //Imagen de Fondo public void paintComponent(Graphics g) { Image img = Toolkit.getDefaultToolkit().getImage( Menu.class.getResource("/imgs/rotom.jpg")); g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this); }

Resource from assembly as a stream

只愿长相守 提交于 2019-11-26 22:46:38
问题 I have an image in a C# WPF app whose build action is set to 'Resource'. It's just a file in the source directory, it hasn't been added to the app's resource collection through the drag/drop properties dialog. I'm trying to write it as a stream, but I can't open it despite trying quite a few variations of dots, slashes, namespaces and seemingly everything else. I can access it to use elsewhere either in xaml with "pack://application:,,,/Resources/images/flags/tr.png", but I can't get at a

Embedded Font Causes a Crash

扶醉桌前 提交于 2019-11-26 22:12:04
问题 I have a WinForm app. I am using a custom font that is in my embedded resources. It works at first, but then causes the program to crash after a while. Using the following code as an example, if I keep resizing the form, forcing it to constantly redraw itself, it will crash within a few seconds. The message I get is ' Error in 'Form1_Paint()'. Object is currently in use elsewhere. '. What am I doing wrong? How can I avoid this? I got the font from here. Thanks. Imports System.Drawing.Text

Java Path ImageIcon URL .JAR

笑着哭i 提交于 2019-11-26 21:58:19
问题 I may have made of try, none works.. The file is: /Users/Toto/Desktop/Titi/IUT/Java/TP2/project/src/fichierPointJava/img1.png fichierPointJava is the name of the package . I launch the ant when I am situated in project which contains the build.xml Here are the codes that I tested: URL urlImage1=this.getClass().getClassLoader.getResource("/src/fichierPointJava/img1.png"); URL urlImage1=this.getClass().getClassLoader.getResource("/fichierPointJava/img1.png"); URL urlImage1=this.getClass()

FileNotFoundException when trying to load Autofac as an embedded assembly

99封情书 提交于 2019-11-26 21:36:43
问题 Previous versions of Autofac worked, but since they switched to making it a Portable Class Library it won't load. I tried applying the fix listed here (KB2468871) but it told me that it was not needed. The error goes away when I move the Autofac.dll file into the same location as the executable. When it loads it from the external DLL it loads fine. Why won't it work as an embedded DLL? Here is the exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Core,

How can I force Proguard to keep my .xml resource file?

徘徊边缘 提交于 2019-11-26 21:36:14
问题 I am succesfully using proguard for my Android apps. However, with one app I am having trouble. This app uses a java library that has a .xml file that is stored in the package. InputStream istream = Library.class.getResourceAsStream("resource.xml"); This library works great when proguard is disabled. However, running proguard, it seems that the xml file is just completely stripped away. Relevant proguard.cfg -optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses

Including a text file inside a jar file and reading it [duplicate]

无人久伴 提交于 2019-11-26 21:23:13
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Java resource as file I am kind of new to Java and I am trying to get a text file inside a Jar file. At the moment when I execute my jar I have to have my text file in the same folder as the jar fil. If the text file is not there I'll get a NullPointerException , which I want to avoid. What I want to do is to get the txt file inside the jar so I wont have this problem. I tried some guides but they didn't seem to

Strange behavior of Class.getResource() and ClassLoader.getResource() in executable jar

孤人 提交于 2019-11-26 20:02:40
I understand from What is the difference between Class.getResource() and ClassLoader.getResource()? and from own code, that getClass().getResource("/path/image.png") is identical to getClass().getClassLoader().getResource("path/image.png") The posting Cannot read an image in jar file shows an issue where using getClass().getClassLoader().getResource("path/image.png") in an executable jar file returns null, while getClass().getResource("/path/image.png") returns the correct URL. Since Class.getResource() delegates to ClassLoader.getResource() after removing the leading slash, I would expect