Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to compile code output because of some reference assembly goofups
    primarykey
    data
    text
    <p>My issue goes like this:</p> <p>There is a project called <code>myframework</code>. It has some extension methods defined in it as follows:</p> <pre><code>namespace myframework { public static class Helpers { public static bool ContainsAll(this string obj, string[]) { return true; } } } </code></pre> <p>It also has some other stuff like interfaces, etc, etc. </p> <p>There is a second class I generate via System.CodeDom classes. The generated output is somewhat like this:</p> <pre><code>using myframework; public class A: IMyFrameworkInterface { public void foo() { string s ="HELLO"; if(s.ContainsAll(some_arr)) return; } //More methods defined... } </code></pre> <p>The compiler options I pass which is created prior to the actual compile call references the correct assemblies</p> <pre><code>var cp = new CompilerParameters(); cp.ReferencedAssemblies.Add("System.dll"); cp.ReferencedAssemblies.Add("myframework.dll"); </code></pre> <p>The code compilation modules are written in a different project. The particular class responsible for this also nicely gives us access to a list of CompilerError object via which we can learn the result of compilation.</p> <p><strong>Issue1:</strong> When I tried this in an asp.net project the compiler threw error saying it could not find metadata file myframework.dll (despite it being referenced in the project).</p> <p><strong>Issue2:</strong> When I tried it with a windows forms project. It gave a different error. This time saying that string does not contain definition for ContainsAll()</p> <p>How to solve these two specific problems?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload