Server Error in '/' Application.

String reference not set to an instance of a String.
Parameter name: s

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: String reference not set to an instance of a String.
Parameter name: s

Source Error:


Line 14:     public static string RemoverAcentos(string txt)
Line 15:     {
Line 16:         byte[] bytes = System.Text.Encoding.GetEncoding("Cyrillic").GetBytes(txt);
Line 17:         return System.Text.Encoding.ASCII.GetString(bytes);
Line 18:     }

Source File: \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\App_Code\Utilitario.cs    Line: 16

Stack Trace:


[ArgumentNullException: String reference not set to an instance of a String.
Parameter name: s]
   System.Text.Encoding.GetBytes(String s) +12997568
   Utilitario.RemoverAcentos(String txt) in \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\App_Code\Utilitario.cs:16
   Utilitario.Slugify(String phrase) in \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\App_Code\Utilitario.cs:27
   Linha.URL(String id, String nome, String baseUrl) in \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\App_Code\Linha.cs:150
   hidrometros_medidores_listagem.DadosPagina(String idCategoria, String idLinha) in \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\hidrometros-medidores\listagem.aspx.cs:51
   hidrometros_medidores_listagem.Page_Load(Object sender, EventArgs e) in \\windows-pd-0001.fs.locaweb.com.br\wnfs-0001\hidrovolt1\web\hidrometros-medidores\listagem.aspx.cs:23
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.9224.0