My app bundles a set of VBScripts (UTF8 text files) into a VB.NET assembly. I used to embed the script code into the classes as String members, but this is proving to be a poor design. I want to include them as resources instead. What's the best way to add resources to the CompilerParams?
What I've got so far (excluding all the error checks):
Dim comParams As New CompilerParameters()
comParams.OutputAssembly = DLL_Path
comParams.ReferencedAssemblies.Add("System.dll")
comParams.ReferencedAssemblies.Add("System.Windows.Forms.dll")
comParams.ReferencedAssemblies.Add("System.Drawing.dll")
comParams.ReferencedAssemblies.Add("mscorlib.dll")
comParams.ReferencedAssemblies.Add(RhinoDotNETSDKPath)
comParams.WarningLevel = 3
comParams.CompilerOptions = "/target:library /optimize"
comParams.GenerateExecutable = False
comParams.GenerateInMemory = False
Dim iCode As String = Me.DotNETSource
Dim iProvider As CodeDomProvider = CodeDomProvider.CreateProvider("VB")
comResult = iProvider.CompileAssemblyFromSource(comParams, New String() {iCode})
The CompilerParameters contain fields for EmbeddedResources and LinkedResources, but from the examples I found so far these seem to pertain only to framework resources???