CSC : error CS7038: Failed to emit module

Orlando Helmer picture Orlando Helmer · Jul 29, 2015 · Viewed 14.7k times · Source

After installing Visual Studio 2015 and building my project I receive the error

"CSC : error CS7038: Failed to emit module".

However my solution is building fine in Visual Studio 2013.

It is an ASP.NET webforms project .NET 4.0

Anyone?

UPDATE: it looks like the problem has to do with Red Gate Smart Assembly in combination with method parameters with default values.

UPDATE: Smart Assembly 6.9 fixes the error for me.

Answer

Scooter picture Scooter · Jul 4, 2016

Original Snippet:

    private void radButton1_Click(object sender, EventArgs e)
    {
        string perp = radTextBox1.Text;

        int i = 0;
        DataRow arp = ale.Rows[i];
        while (i <= ale.Rows.Count)
        {
            if (ale.Rows[i].Field<>("FullName") = perp)
            {
                arp = ale.Rows[i];
                ale.Rows.Remove(arp);
            }

        }

        i = ale.Rows.Count;
        radLabel1.Text = i.ToString();
    }

Changed this:

    if (ale.Rows[i].Field<>("FullName") = perp)

To This:

    if (ale.Rows[i].Field<String>("FullName") == perp)