GetManifestResourceStream returns NULL

前端 未结 13 2659
走了就别回头了
走了就别回头了 2020-11-28 05:41

This is a C# .NET 4.0 application:

I\'m embedding a text file as a resource and then trying to display it in a dialog box:

    var assembly = Assembl         


        
13条回答
  •  春和景丽
    2020-11-28 06:03

    The embedded file's "Build Action" property should be set as "Embedded Resource" to run the line, which is given below, properly:

    Stream stream = assembly.GetManifestResourceStream(resourceName)
    

    Right click on the file, click the property and then set "Build Action" property as "Embedded Resource":

提交回复
热议问题