This is a migrated thread and some comments may be shown as answers.

JustCode manage compiler option Asp.Net

7 Answers 64 Views
Code Analysis
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stephane
Top achievements
Rank 1
Stephane asked on 02 Aug 2010, 02:11 PM
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.

7 Answers, 1 is accepted

Sort by
0
Hans Kratz
Telerik team
answered on 04 Aug 2010, 12:22 PM
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
0
Stephane
Top achievements
Rank 1
answered on 05 Aug 2010, 08:42 AM
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.
0
Accepted
Hans Kratz
Telerik team
answered on 11 Aug 2010, 08:05 PM
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
0
Stephane
Top achievements
Rank 1
answered on 12 Aug 2010, 08:45 AM
Hi,
I win some points?

;-)
0
Accepted
Hans Kratz
Telerik team
answered on 12 Aug 2010, 01:39 PM
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
0
Stephane
Top achievements
Rank 1
answered on 12 Aug 2010, 01:43 PM
Thanks a lot!
0
Hans Kratz
Telerik team
answered on 12 Aug 2010, 02:02 PM
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
Tags
Code Analysis
Asked by
Stephane
Top achievements
Rank 1
Answers by
Hans Kratz
Telerik team
Stephane
Top achievements
Rank 1
Share this question
or