Search code examples
c#resourcesresxcsc

Compiling VS 2012 project programmatically?


I have this class library project sitting in a solution.

My need is to be able to embed resources (all files from 'Resources' folder) into DatabaseResources.resx and compile it all into an assembly, on the fly.

enter image description here

I tried CSC and was able to compile it

csc /target:library /out:MyClassLibrary.dll  /res:ContentChangeLog.gz /res:CountryBillingRules.gz /res:Finance.gz /res:Instructions.xml /res:Language.gz /res:Masters.gz /res:wbs.gz /res:wbsList.gz 

But, MyClassLibrary.dll should be exposing these resources thru DatabaseResources.resx so that others can find it- MyClassLibrary.DatabaseResources.(resource name)

enter image description here

I couldn't find a way to do the same with CSC.

Any help appreciated.


Solution

  • I guess what you are looking for is MsBuild.

    a good explanation here - Some confusions about Command Line Compiler and MSBuild