मैं/linkres साथ एक बाइनरी फ़ाइल को एम्बेड कर रहा हूँ:नहीं कर सकते लोड एम्बेडेड संसाधन
System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
string[] names = myAssembly.GetManifestResourceNames(); // it is really there by its name "shader.tkb"
Stream myStream = myAssembly.GetManifestResourceStream(names[0]);
यह एक
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'shader.tkb' or one of its dependencies. The system cannot find the file specified. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeAssembly.GetResource(RuntimeAssembly assembly, String resourceName, UInt64& length, StackCrawlMarkHandle stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.RuntimeAssembly.GetManifestResourceStream(String name)
की ओर जाता है: संकलक तर्क है, लेकिन जब मैं के साथ लोड करने का प्रयास
यहां समस्या क्या है?
विज्ञापन 1) मैं कमांड लाइन पर इसे कैसे निर्दिष्ट करूं? मेरे पास विजुअल स्टूडियो नहीं है। – clamp
आपने सी # नमूना दिया, मुझे यकीन नहीं है कि आप क्या करने की कोशिश कर रहे हैं। –
GetManifestResourceNames() प्रकाश को शेड करता है –