Error "Tag xxx is not closed" on asax files - C# projects

Hey everybody

I'm using Rider to develop C# Web apps, and get a inspection error on asax file :

“Tag xxx is not closed”

on line

private static Dictionary<string, string> _lstErrFonct;

It doesn't generate any issue on building the project, only anoying inspection errors.

What should I do to “correct” or suppress those errors.

Regards.

Alain

0
3 comments

Could you share the asax file contents? (or a minimal reproducible example)

I will check if it's a false positive inspection result on the usage.

0

The error stands in line (I just change the original one) :

 private static Dictionary<string, string> _sString007;

Here is the (obfuscated) code 

using AllClasses;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace MyNamespace
{
   public class WebApiApplication : System.Web.HttpApplication
   {

       #region Champs

       private static Class001 _oClasse001;
       private static Class001 _oClasse002;
       private static List<Class002> _oClasse003;
       private static Class003 _oClasse004;

       private static string _sString001;
       private static string _sString002;
       private static string _sString003;
       private static string _sString004;
       private static long _lLong001;
       private static string _sString005;
       private static string _sString006;
       private static Dictionary<string, string> _sString007;

       #endregion


       #region Propriétés

       internal static List<Class002> Classe003
       {
           get { return _oClasse003; }
       }
       
       internal static Class001 Classe001
       {
           get { return _oClasse001; }
       }

       internal static Class001 Classe002
       {
           get { return _oClasse002; }
       }

       internal static Class003 Classe004
       {
           get { return _oClasse004; }
       }

       internal static string String001
       {
           get { return _sString001; }
       }

       internal static string String002
       {
           get { return _sString002; }
       }

       internal static string String003
       {
           get { return _sString003; }
       }

       internal static string String006
       {
           get { return _sString006; }
       }

       internal static long Long001
       {
           get { return _lLong001; }
       }

       internal static string String004
       {
           get { return _sString004; }
       }

       internal static Dictionary<string, string> String007
       {
           get { return _sString007; }
       }

       #endregion


       #region Constructeurs / desctructeurs

       /// <summary>
       /// Constructeur
       /// </summary>
       public WebApiApplication()
       {

           _sString001 = ConfigurationManager.AppSettings["Settings001"];
           _sString002 = ConfigurationManager.AppSettings["Settings002"];
           _sString003 = ConfigurationManager.AppSettings["Settings003"];

           _sString005 = ConfigurationManager.AppSettings["Settings005"];

           _sString006 = ConfigurationManager.AppSettings["Settings006"];
           _sString004 = ConfigurationManager.AppSettings["Settings004"];

           _lLong001 = long.Parse(ConfigurationManager.AppSettings["Long001"]);

           string sKey = ConfigurationManager.AppSettings["String007"];
           _sString007 = sKey.ToDictionary(';', '=');
     
       }

       #endregion

       #region Méthodes

       /// <summary>
       /// Démarrage de l'application
       /// </summary>
       protected void Application_Start()
       {
           _oClasse001 = ConnectionStringFactory.GetConnectionDb("Class001");

           _oClasse004 = new Class003(_sString001, _oClasse001);

           _oClasse002 = _oClasse004.GetConnexion("Class002");
           _oClasse003 = _oClasse004.Classe003;

           this.InitializeJSOnLicense();

       }

       #endregion

   }
}
 

0

I tried with the sample you provided but don't see the same results. 

Could you try with invalidate caches (File | Invalidate Caches)? Reset project cache to see if it works. You can also delete the .idea folder in your solution root directory to reset the project settings.

Also, I think the inspection “tag is not closed” should only applied on XML-like files. Not quite understand why C# code placed in asax but not in the C# file behind it..

0

Please sign in to leave a comment.