Broken compatibility for assembly GetNAme() in 2.0

Discussion in 'ASP .Net' started by WT, May 13, 2006.

  1. WT

    WT Guest

    Hello,


    We have a license system that checks the assembly name and version using
    ..NETLicenseManager API (Cf Nikhil K. book on server controls) , using a
    deployment project we are able to set the assmbly name and version for
    resulting dll, and it works ok.
    string assemblyPart = type.Assembly.GetName().Name;

    string versionPart = type.Assembly.GetName().Version.ToString();


    But in dev phase, our assembly name is automatically generated without
    possibility of control and it is very uneasyto work with, solution should be
    to put #if everywere the license is tested or the assembly name is get from
    ..net, but this practice doesn't allow real testing.

    So what to do: something has been broken here going from 1.1 to 2.0.
    What to do ?
    Any idea welcome.

    CS
    WT, May 13, 2006
    #1
    1. Advertising

  2. Hi MT,

    Thank you for posting!

    Regarding the code:

    string assemblyPart = type.Assembly.GetName().Name;

    Can you tell me where is the 'type' from? Is it from a Page class?

    And I'm not quite clear about your question about "something has been
    broken here going from 1.1 to 2.0". Have you tried the suggestion provided
    by Ken Cox in your other post regarding this issue? BTW, the Web
    Application Projects 1.0 is released just a few days ago. This new model is
    ideal for web site developers who are converting a Visual Studio .Net 2003
    web project to Visual Studio 2005.


    Regards,

    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], May 15, 2006
    #2
    1. Advertising

  3. Hi CS,

    Sorry for the typo in your name in previous post.

    Regards,

    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], May 15, 2006
    #3
  4. WT

    WT Guest

    Hello Walter,

    No pb with typo.
    Concerning the Ken Cox answer, I don't see it, I will refresh my outlook
    subscription to this newsgroup.
    My project is now converted to 2.0.
    type is an instance of a class that resides in the App_Code folder, when I
    run my web application under VS2005 debuger , I get in assemblyPart a name
    like App_dzk23, each new run gives a different name.
    So it is uneasy to test something.

    Regards
    CS

    "Walter Wang [MSFT]" <> a écrit dans le message
    de news: ...
    > Hi MT,
    >
    > Thank you for posting!
    >
    > Regarding the code:
    >
    > string assemblyPart = type.Assembly.GetName().Name;
    >
    > Can you tell me where is the 'type' from? Is it from a Page class?
    >
    > And I'm not quite clear about your question about "something has been
    > broken here going from 1.1 to 2.0". Have you tried the suggestion provided
    > by Ken Cox in your other post regarding this issue? BTW, the Web
    > Application Projects 1.0 is released just a few days ago. This new model
    > is
    > ideal for web site developers who are converting a Visual Studio .Net 2003
    > web project to Visual Studio 2005.
    >
    >
    > Regards,
    >
    > Walter Wang
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    WT, May 15, 2006
    #4
  5. Hi CS,

    Have you tried the Web Application Projects addin? Would you mind letting
    me know the result of the suggestions? If you need further assistance, feel
    free to let me know. I will be more than happy to be of assistance.

    Have a great day!

    Regards,

    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], May 18, 2006
    #5
  6. WT

    WT Guest

    Hi Walter,

    Yes it solved it for final project, but in dev phase, assembly name is lost.
    That's a reat problem.

    CS
    "Walter Wang [MSFT]" <> a écrit dans le message
    de news: ...
    > Hi CS,
    >
    > Have you tried the Web Application Projects addin? Would you mind letting
    > me know the result of the suggestions? If you need further assistance,
    > feel
    > free to let me know. I will be more than happy to be of assistance.
    >
    > Have a great day!
    >
    > Regards,
    >
    > Walter Wang
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no
    > rights.
    >
    WT, May 18, 2006
    #6
  7. Thank you for your quick response.

    I've done some test using Web Application Projects add-in, but was unable
    to reproduce the problem. Here's the steps I used to test it:

    1) Create a new Visual C# "ASP.NET Web Application"
    2) Create a new class Class1
    3) In Default.aspx.cs, Page_Load:

    Class c1 = new Class1();
    Response.Write(c1.GetType().Assembly.GetName());

    The result shows correctly the Project's assembly name.

    If I use following code in Page_Load:

    Response.Write(this.GetType().Assembly.GetName());

    It does show an assembly name which is dynamic, but I think it's the same
    behavior with ASP.NET 1.1 which is expected.

    If there is anything I misunderstood, please feel free to post reply here.


    Regards,

    Walter Wang
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], May 18, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    1
    Views:
    8,287
    Paul Tomblin
    Jun 27, 2003
  2. Rico
    Replies:
    4
    Views:
    398
    Chris Smith
    Dec 1, 2003
  3. Rico
    Replies:
    4
    Views:
    416
    Michael Borgwardt
    Dec 2, 2003
  4. Robert Mark Bram

    class.getName()

    Robert Mark Bram, Jun 17, 2004, in forum: Java
    Replies:
    8
    Views:
    4,071
    Jeff Robertson
    Jun 18, 2004
  5. Replies:
    1
    Views:
    442
    John C. Bollinger
    May 2, 2005
Loading...

Share This Page