c# - is a Field but used like a Type error -


did miss "using"? because how see use instance not type.

the error appears first time use of "settings"

using system; using system.collections.generic; using system.linq; using system.text; using system.xml; using system.windows.markup;  namespace ampelthingy {     class save     {         stringbuilder outstr = new stringbuilder();          xmlwritersettings settings = new xmlwritersettings();         settings.indent = true;         settings.omitxmldeclaration = true;         settings.newlineonattributes = true;           xamldesignerserializationmanager dsm = new xamldesignerserializationmanager(xmlwriter.create(outstr, settings));         dsm.xamlwritermode = xamlwritermode.expression;          xamlwriter.save(wrappanel1, dsm);         string savedcontrols = outstr.tostring();          file.writealltext(@"aa.xaml", savedcontrols);     } } 

theres lot more wrong code, please wrap code in method.

you have

namespace {     class     {       /* code*/     } } 

it should wrapped in method:

namespace {     class     {         save()         {           //do thing.         }       } } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -