In VB.Net (VS 2013), I've added a text file as a resource to my project.
In LinqPad, I can query this file and get the desired result:
dim pre = (From line In File.ReadAllLines("F:\zUsers\Kap\Documents\Visual Studio 2013\Projects\LCT\MemberTicketEntry\ValidPrefixes.txt")
where line = "LCT").singleordefault
If the file contains "LCT" as a line, it gets stored in pre.
But, in Visual Studio, when I substitute the hard coded text file with a resource (with Build set as Content), I get no results:
Dim pre As String = (From line In File.ReadAllLines(My.Resources.ValidPrefixes) _
Where line = prefix).SingleOrDefault
I don't get an error, but the Debug.print line never runs, even if I set a break point.
So, my question is:
How can I query a text file that's in my project resources?
PS: I can always just use the hard coded path (with application path), but it seems cleaner to include it as a resource -- for one reason, it would auto update with OneClick installs (I think).