GetExecutingAssembly and GetManifestResourceStream

SyntaxEditor for WPF Forum

Posted 11 years ago by vijaykumar
Version: 12.2.0573
Avatar

When i pass the path i am not able to stream my language defintion file

public

staticISyntaxLanguage LoadLanguageDefinitionFromResourceStream(stringfilename) {

stringpath = DefinitionPath + filename;

using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(path)) {

if (stream != null) {

SyntaxLanguageDefinitionSerializer serializer = newSyntaxLanguageDefinitionSerializer();

returnserializer.LoadFromStream(stream);}

elsereturnSyntaxLanguage.PlainText;}

}

 

i am getting stream as null.

can u help

Comments (1)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, you probably are passing the wrong path then.  You can use an app like Reflector on your assembly, which allows you to examine your compiled assembly's Resources.  Then you can see the full resource name that the language definition was stored as.  Use whatever that name is.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.