I'm trying to use Debug.Writeline in a razor web page and I keep getting invalid arguments messages.
@System.Diagnostics.Debug.WriteLine("asdf");
returns
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
Debug.WriteLine
does not return a value so it can't be written out using @
. Try:
@{System.Diagnostics.Debug.WriteLine("asdf");}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With