GetManifestResourceStream returns NULL

前端 未结 13 2646
走了就别回头了
走了就别回头了 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:12

    Just a warning.

    I could not access my file as an embedded resource even though I specified that it was and even though it had that Build Action property. Wasted a lot of time banging my head. I embedded a csharp code file with .txt appended to its name (xxx.cs.txt). For some reason the GetManifestResourceNames() and GetManifestResourceStream() methods won't see a file with .cs in its name.

    I renamed it simply xxx.txt and everything was fine.

    Weird.

    0 讨论(0)
提交回复
热议问题