CodeSmith Community
Your Code. Your Way. Faster!

Key with type Uniqueidentifier causes admin page to throw Compilation Error: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

Latest post 08-04-2007 5:44 PM by sisyphe. 3 replies.
  • 04-20-2007 5:01 PM

    • dwrcalgary
    • Top 500 Contributor
    • Joined on 08-21-2006
    • Calgary, Alberta, Canada
    • Posts 9
    • Points 195

    Key with type Uniqueidentifier causes admin page to throw Compilation Error: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    I just got the latest revision 540... and I get the following error when I try to view the Admin Page for Companies:

     

    Compiler Error Message: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    Source Error:

    Line 34:     {
    Line 35:         System.Guid key;
    Line 36: 		System.Guid.TryParse(contextKey, out key);
    Line 37:         
    Line 38:         TestProject.Entities.Companies content 

    Source File: c:\Projects\NetTiers\TestProject.Website\Admin\Companies.aspx.cs    Line: 36
    Filed under:
    • Post Points: 35
  • 04-20-2007 5:04 PM In reply to

    Re: Key with type Uniqueidentifier causes admin page to throw Compilation Error: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    Try changing it to,
    EntityUtil.GuidTryParse
    We'll try to update that.

    On 4/20/07, dwrcalgary < bounce-dwrcalgary@codesmithsupport.com> wrote:

    I just got the latest revision 540... and I get the following error when I try to view the Admin Page for Companies:

     

    Compiler Error Message: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    Source Error:


    Line 34:     {
    Line 35: System.Guid key;
    Line 36: System.Guid.TryParse(contextKey, out key);
    Line 37:
    Line 38: TestProject.Entities.Companies content

    Source File: c:\Projects\NetTiers\TestProject.Website\Admin\Companies.aspx.cs    Line: 36





    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 35
  • 04-20-2007 5:23 PM In reply to

    • dwrcalgary
    • Top 500 Contributor
    • Joined on 08-21-2006
    • Calgary, Alberta, Canada
    • Posts 9
    • Points 195

    Re: Key with type Uniqueidentifier causes admin page to throw Compilation Error: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    Changed:

    System.Guid.TryParse(contextKey, out key);

    To: 

    TestProject.Entities.EntityUtil.GuidTryParse(contextKey, out key);

     

    And that worked.  Thanks.

    • Post Points: 35
  • 08-04-2007 5:44 PM In reply to

    • sisyphe
    • Not Ranked
    • Joined on 08-04-2007
    • Posts 2
    • Points 10

    Re: Key with type Uniqueidentifier causes admin page to throw Compilation Error: CS0117: 'System.Guid' does not contain a definition for 'TryParse'

    Hi,

    Modified the template ASP.NET\Common\Admin\Entity.aspx.cs.cst line 119

    from

      <%= keyType %>.<%= parse %>(contextKey, out key);

    to

      <% if (!keyType.ToLower().Contains("guid")) {%> <%= keyType %>.<% } %><%= parse %>(contextKey, out key);

    Seems to solve the problem at generation stage.

    • Post Points: 5
Page 1 of 1 (4 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems