Embedding .nbin file into C# project [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this questionI am part of a project that nas a requir开发者_Python百科ement for natural language processing. After messing with SharpNLP, I've managed to get it to work quite well and I am now in the process of breaking out the code we need into an easily digestible class library.
One of the challenges I'm having are the .nbin files that SharpNLP requires to operate. In the main download, they are separate files that one must deploy independently. This is not really appropriate for our project since this class library will be used by no fewer than 4 other projects across multiple different machines on our network. The manual step to deploy the .nbins is something the sysadmins have specifically requested I work to remove, and the managers are wary about the extra point of failure from having required resources separated. I realize this will make the resulting .dll big - I've talked that through with everyone and nobody cares.
What is the best way to embed these resources in my project? I can import them fine, but I need to open a Stream object to make the implementation work seamlessly, and opening a Stream on an embedded binary resource has been interesting to say the least.
Set their Build Action
s to Embedded Resource
, then call
typeof(MyType).Assembly.GetManifestResourceStream("Project.Namespace.Folder.File.nbin")
精彩评论