N
nicol
Hi
Error 1 Property or indexer 'System.Exception.Message' cannot be
assigned to -- it is read only
using System;
namespace ConsoleApplication126
{
class Program
{
static void Main(string[] args)
{
string x = null;
try
{
if (x == null)
{
Exception ex = new Exception();
ex.Message = "x was null"; // ****** error**
throw ex;
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}
Error 1 Property or indexer 'System.Exception.Message' cannot be
assigned to -- it is read only
using System;
namespace ConsoleApplication126
{
class Program
{
static void Main(string[] args)
{
string x = null;
try
{
if (x == null)
{
Exception ex = new Exception();
ex.Message = "x was null"; // ****** error**
throw ex;
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
}
}