JustCode manage compiler option Asp.Net

8 posts, 2 answers
  1. Stephane
    Stephane avatar
    27 posts
    Member since:
    Mar 2009

    Posted 02 Aug 2010 Link to this post

    Hi,

    JusteCode manages compiler option in an asp.net  website.

    When I use compiler otpions JusteCode finds a lot of errors.

    see my code sample
    #if MYSQLENTITY
    using VISOnDbEntityMySql;
    #endif
    #if MSSQLENTITY
    using VISOnDbEntityMSSQL;
    #endif
    #if MSSQLENTITY
    using VISOnDbEntity;
    #endif
    #if DBMSSQL
    using VISOnDBMSSQL;
    #endif


    Stéphane.
  2. Hans Kratz
    Admin
    Hans Kratz avatar
    102 posts

    Posted 04 Aug 2010 Link to this post

    Hi Stephane,

    Thanks for the feedback.

    I am sorry but the code sample is not sufficient to reproduce the problem. Could you send us a full file and tell us what values are configured for the preprocessor symbols?


    Best wishes,
    Hans Kratz
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Stephane
    Stephane avatar
    27 posts
    Member since:
    Mar 2009

    Posted 05 Aug 2010 Link to this post

    Hi,
    In my project I use different ADO.net Entity sources according to the configuration of the production server.
    In the wen.config file I define compiler option like this :
    <system.codedom>
            <compilers>
                <!-- Option DEBUG -->
     
                <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/d:DBMSSQL,DEBUG">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="WarnAsError" value="false"/>
                </compiler>
                <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/d:DBMSSQL,DEBUG">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="OptionInfer" value="true"/>
                    <providerOption name="WarnAsError" value="false"/>
                </compiler>
     
                <!-- Option RELEASE -->
                <!--
                <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/d:DBMSSQL">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="WarnAsError" value="false"/>
                </compiler>
                <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/d:DBMSSQL">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="OptionInfer" value="true"/>
                    <providerOption name="WarnAsError" value="false"/>
                </compiler>
    -->
            </compilers>
     
        </system.codedom>

    I define the connection string also.

    I create a class which manages the acces to the entities. a piece of class:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.ComponentModel;
    using System.Linq.Dynamic;
    using System.Text;
    using System.Reflection;
    using System.Security.Permissions;
    using System.Security;
    using System.Configuration;
    using System.Data.SqlClient;
    using System.IO;
    #if MYSQLENTITY
    using VISOnDbEntityMySql;
    #endif
    #if MSSQLENTITY
    using VISOnDbEntityMSSQL;
    #endif
    #if MSSQLENTITY
    using VISOnDbEntity;
    #endif
    #if DBMSSQL
    using VISOnDBMSSQL;
    using System.Diagnostics;
    #endif
     
    [DataObject(true)]
    /// <summary>
    /// Description résumée de DataItemFacade
    /// </summary>
    public class DataItemFacade
    {
        private Categorie ToutCategorie;
        private VISOnDBEntities entities = null;
        public DataItemFacade()
        {
            ToutCategorie = new Categorie() { code = "__TOUTCATEGORIE__", Libelle = "Toute les categories" };
            entities = new VISOnDBEntities();
        }
             
        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<Batiment> GetAllBatiment()
        {
            return entities.Batiment.Include("ThemeVisite").ToList();
        }
        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<ThemeVisite> GetThemeVisiteForBatiment(int idBatiment)
        {
            return entities.ThemeVisite.Include("Batiment").Where(tv => tv.Batiment.idBatiment == idBatiment).ToList();
     
        }
        [DataObjectMethod(DataObjectMethodType.Select)]
        public List<PointObservation> GetPOForBatiment(int idBatiment)
        {
            return entities.PointObservation.Include("Salle.Etage.Batiment").Where(po => po.Salle.Etage.Batiment.idBatiment == idBatiment).ToList();
        }

    I see in the forum that JustCode has some problem with partial class, this bug is closed?

    Bye.

    Stéphane.
  5. Answer
    Hans Kratz
    Admin
    Hans Kratz avatar
    102 posts

    Posted 11 Aug 2010 Link to this post

    Hi Stephane,

    thanks for filling in the blanks. You are right, JustCode does not pick up preprocessor defines from the web.config file. I have added this report to our product backlog and we plan to implement that in a future version. You will be automatically notified once it is implemented.

    Best wishes,
    Hans Kratz
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Stephane
    Stephane avatar
    27 posts
    Member since:
    Mar 2009

    Posted 12 Aug 2010 Link to this post

    Hi,
    I win some points?

    ;-)
  7. Answer
    Hans Kratz
    Admin
    Hans Kratz avatar
    102 posts

    Posted 12 Aug 2010 Link to this post

    Hello Stephane,

    sorry, I forgot. I have awarded you 800 Telerik points for your report.

    Regards,
    Hans Kratz
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Stephane
    Stephane avatar
    27 posts
    Member since:
    Mar 2009

    Posted 12 Aug 2010 Link to this post

    Thanks a lot!
  9. Hans Kratz
    Admin
    Hans Kratz avatar
    102 posts

    Posted 12 Aug 2010 Link to this post

    Hi Stephane,

    OK, I am closing this ticket.

    Kind regards,
    Hans Kratz
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner