C# CompileAssemblyFromSource, add referenced assemblies it needs?

后端 未结 1 1856
旧时难觅i
旧时难觅i 2021-01-12 09:23

I have the CompileAssemblyFromSource working for code that only references assemblies that my program (that compiles it) uses. It works beautifully.

However, if I n

相关标签:
1条回答
  • 2021-01-12 10:05
    1. Read the article How the Runtime Locates Assemblies
    2. Before compiling the code load all the assemblies found in the locations mentioned in point 1
    3. Load all the types in all the assemblies and keep a dictionary of namespace, type pair
    4. When a using is encountered in the source try adding reference of assemblies from the dictionary in 3
    0 讨论(0)
提交回复
热议问题