Kurubaran Kurubaran - 1 year ago 136
C# Question

Embedded statement cannot be a declaration .Net 2.0 vs 4.0

I have the following declarations in my code which works fine in .net frame work 2.0, Recently i upgraded the project to frame work 4.0 and Im getting the build error saying

"Embedded statement cannot be a declaration"

Any idea what is wrong here ?

const int sNoPrompt = 0x1;
const int sUseFileName = 0x2;
const Int32 sEmbedFonts = 0x10;
const int MultilingualSupport = 0x80;

Answer Source

I figured it out, There was a IF statment right above the declaration without curly braces. Whcih was causing the error. I just removed the IF as it wasn't necessary in my case. now it works fine.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download