c# - Visual Studio 2015 designer crash -


i have method:

static public void writeerrortofile(string errormassege, string helplink) {     string text = datetime.now.tostring() + ":" + environment.newline + errormassege + environment.newline;      if (!string.isnullorwhitespace(helplink))     {         text += "help link: " + helplink + environment.newline;     }      text += environment.newline;     file.appendalltext("errors.txt", text); } 

i call method every time expception occurred, designer in visual studio 2015 crashes massege:

unauthorizedaccessexception: access path 'c:\program files (x86)\microsoft visual studio 14.0\common7\ide\errors.txt' denied.

if mean call function in myviewmodel datacontext of page. if delete errors.txt file normal again. knows why happen , soulution?

the problem wpf designer has execute code see data available on viewmodel designerproperties contains method getisindesignmode can use disable logic when code being executed designer


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -