Assembly versioning in web.config

Discussion in 'ASP .Net' started by JohnD, Dec 10, 2008.

  1. JohnD

    JohnD Guest

    Hello all,

    I have references to a number of my own assemblies in my web.config:

    "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"

    Now, every time I create a new revision of my assembly (9786 becomes 9787
    for example) I need to change the text in my web.config file, which is a bit
    of a pain.

    Is there any way to configure this so that the highest revision is always
    loaded? I've tried specfiying just 12.0.5, but that fails. I know I can use
    assembly redirection but that requires me to specify the new version number.
    I just want to replace the old assembly file with the new assembly file, and
    have it "just work".

    Can it be done?

    Thanks,

    /john
    JohnD, Dec 10, 2008
    #1
    1. Advertising

  2. JohnD

    Sam Guest

    On Dec 10, 5:19 am, "JohnD" <> wrote:
    > Hello all,
    >
    > I have references to a number of my own assemblies in my web.config:
    >
    > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    >
    > Now, every time I create a new revision of my assembly (9786 becomes 9787
    > for example) I need to change the text in my web.config file, which is a bit
    > of a pain.
    >
    > Is there any way to configure this so that the highest revision is always
    > loaded? I've tried specfiying just 12.0.5, but that fails. I know I can use
    > assembly redirection but that requires me to specify the new version number.
    > I just want to replace the old assembly file with the new assembly file, and
    > have it "just work".
    >
    > Can it be done?
    >
    > Thanks,
    >
    > /john


    The version is optional, you do not have to specify the version number
    in your 'type' statement, so don't include a version number.
    Sam, Dec 11, 2008
    #2
    1. Advertising

  3. JohnD

    JohnD Guest

    Hi Sam,

    Thanks, but not in this case I think. And it never occurred to me that there
    would be a difference. The assembly reference I have is actually a language
    provider in codedom, so the full fragment is:

    <system.web>
    <compilation debug="true" batch="false">
    <compilers>
    <compiler language="lang" extension=".l"
    type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff" />
    </compilers>
    </compilation>
    </system.web>

    If I remove the version, or the entire assembly reference that I get a
    "could not load assembly" exception.

    Thanks again.
    /john



    "Sam" <> wrote in message
    news:...
    On Dec 10, 5:19 am, "JohnD" <> wrote:
    > Hello all,
    >
    > I have references to a number of my own assemblies in my web.config:
    >
    > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    >
    > Now, every time I create a new revision of my assembly (9786 becomes 9787
    > for example) I need to change the text in my web.config file, which is a
    > bit
    > of a pain.
    >
    > Is there any way to configure this so that the highest revision is always
    > loaded? I've tried specfiying just 12.0.5, but that fails. I know I can
    > use
    > assembly redirection but that requires me to specify the new version
    > number.
    > I just want to replace the old assembly file with the new assembly file,
    > and
    > have it "just work".
    >
    > Can it be done?
    >
    > Thanks,
    >
    > /john


    The version is optional, you do not have to specify the version number
    in your 'type' statement, so don't include a version number.
    JohnD, Dec 11, 2008
    #3
  4. JohnD

    Sam Guest

    On Dec 11, 1:35 am, "JohnD" <> wrote:
    > Hi Sam,
    >
    > Thanks, but not in this case I think. And it never occurred to me that there
    > would be a difference. The assembly reference I have is actually a language
    > provider in codedom, so the full fragment is:
    >
    >   <system.web>
    >     <compilation debug="true" batch="false">
    >       <compilers>
    >         <compiler language="lang" extension=".l"
    > type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff" />
    >       </compilers>
    >     </compilation>
    >   </system.web>
    >
    > If I remove the version, or the entire assembly reference that I get a
    > "could not load assembly" exception.
    >
    > Thanks again.
    > /john
    >
    > "Sam" <> wrote in message
    >
    > news:...
    > On Dec 10, 5:19 am, "JohnD" <> wrote:
    >
    >
    >
    > > Hello all,

    >
    > > I have references to a number of my own assemblies in my web.config:

    >
    > > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"

    >
    > > Now, every time I create a new revision of my assembly (9786 becomes 9787
    > > for example) I need to change the text in my web.config file, which is a
    > > bit
    > > of a pain.

    >
    > > Is there any way to configure this so that the highest revision is always
    > > loaded? I've tried specfiying just 12.0.5, but that fails. I know I can
    > > use
    > > assembly redirection but that requires me to specify the new version
    > > number.
    > > I just want to replace the old assembly file with the new assembly file,
    > > and
    > > have it "just work".

    >
    > > Can it be done?

    >
    > > Thanks,

    >
    > > /john

    >
    > The version is optional, you do not have to specify the version number
    > in your 'type' statement, so don't include a version number.


    The 'compiler' element must have a fully qualified assembly name which
    includes the version: http://msdn.microsoft.com/en-us/library/y9x69bzw.aspx..
    Other elements like the 'add' for httpModules do not require fully
    qualified names and you can omit the version. So in your case you
    have no choice but to specifiy the version.
    Sam, Dec 11, 2008
    #4
  5. JohnD

    JohnD Guest

    Hi Sam,

    Thanks for the link, I'd seen that, but I was hoping that there was some
    magic syntax to allow me to "wildcard" some of the version information. I
    guess not.

    Thanks for you time and help.

    /john

    "Sam" <> wrote in message
    news:...
    On Dec 11, 1:35 am, "JohnD" <> wrote:
    > Hi Sam,
    >
    > Thanks, but not in this case I think. And it never occurred to me that
    > there
    > would be a difference. The assembly reference I have is actually a
    > language
    > provider in codedom, so the full fragment is:
    >
    > <system.web>
    > <compilation debug="true" batch="false">
    > <compilers>
    > <compiler language="lang" extension=".l"
    > type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    > />
    > </compilers>
    > </compilation>
    > </system.web>
    >
    > If I remove the version, or the entire assembly reference that I get a
    > "could not load assembly" exception.
    >
    > Thanks again.
    > /john
    >
    > "Sam" <> wrote in message
    >
    > news:...
    > On Dec 10, 5:19 am, "JohnD" <> wrote:
    >
    >
    >
    > > Hello all,

    >
    > > I have references to a number of my own assemblies in my web.config:

    >
    > > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"

    >
    > > Now, every time I create a new revision of my assembly (9786 becomes
    > > 9787
    > > for example) I need to change the text in my web.config file, which is a
    > > bit
    > > of a pain.

    >
    > > Is there any way to configure this so that the highest revision is
    > > always
    > > loaded? I've tried specfiying just 12.0.5, but that fails. I know I can
    > > use
    > > assembly redirection but that requires me to specify the new version
    > > number.
    > > I just want to replace the old assembly file with the new assembly file,
    > > and
    > > have it "just work".

    >
    > > Can it be done?

    >
    > > Thanks,

    >
    > > /john

    >
    > The version is optional, you do not have to specify the version number
    > in your 'type' statement, so don't include a version number.


    The 'compiler' element must have a fully qualified assembly name which
    includes the version: http://msdn.microsoft.com/en-us/library/y9x69bzw.aspx.
    Other elements like the 'add' for httpModules do not require fully
    qualified names and you can omit the version. So in your case you
    have no choice but to specifiy the version.
    JohnD, Dec 12, 2008
    #5
  6. John,

    I don't know if it would work for you, but if you don't have applications
    running old versions of your assembly then you could just hardcode the
    version number in the assembly itself. Then even when revised the version
    number would stay the same and you wouldn't have to change it ever.

    Of course if you need versioning of the assembly itself this won't work for
    you at all.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche




    "JohnD" <> wrote in message
    news:%...
    > Hi Sam,
    >
    > Thanks for the link, I'd seen that, but I was hoping that there was some
    > magic syntax to allow me to "wildcard" some of the version information. I
    > guess not.
    >
    > Thanks for you time and help.
    >
    > /john
    >
    > "Sam" <> wrote in message
    > news:...
    > On Dec 11, 1:35 am, "JohnD" <> wrote:
    >> Hi Sam,
    >>
    >> Thanks, but not in this case I think. And it never occurred to me that
    >> there
    >> would be a difference. The assembly reference I have is actually a
    >> language
    >> provider in codedom, so the full fragment is:
    >>
    >> <system.web>
    >> <compilation debug="true" batch="false">
    >> <compilers>
    >> <compiler language="lang" extension=".l"
    >> type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    >> />
    >> </compilers>
    >> </compilation>
    >> </system.web>
    >>
    >> If I remove the version, or the entire assembly reference that I get a
    >> "could not load assembly" exception.
    >>
    >> Thanks again.
    >> /john
    >>
    >> "Sam" <> wrote in message
    >>
    >> news:...
    >> On Dec 10, 5:19 am, "JohnD" <> wrote:
    >>
    >>
    >>
    >> > Hello all,

    >>
    >> > I have references to a number of my own assemblies in my web.config:

    >>
    >> > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"

    >>
    >> > Now, every time I create a new revision of my assembly (9786 becomes
    >> > 9787
    >> > for example) I need to change the text in my web.config file, which is
    >> > a
    >> > bit
    >> > of a pain.

    >>
    >> > Is there any way to configure this so that the highest revision is
    >> > always
    >> > loaded? I've tried specfiying just 12.0.5, but that fails. I know I can
    >> > use
    >> > assembly redirection but that requires me to specify the new version
    >> > number.
    >> > I just want to replace the old assembly file with the new assembly
    >> > file,
    >> > and
    >> > have it "just work".

    >>
    >> > Can it be done?

    >>
    >> > Thanks,

    >>
    >> > /john

    >>
    >> The version is optional, you do not have to specify the version number
    >> in your 'type' statement, so don't include a version number.

    >
    > The 'compiler' element must have a fully qualified assembly name which
    > includes the version:
    > http://msdn.microsoft.com/en-us/library/y9x69bzw.aspx.
    > Other elements like the 'add' for httpModules do not require fully
    > qualified names and you can omit the version. So in your case you
    > have no choice but to specifiy the version.
    S. Justin Gengo, Dec 12, 2008
    #6
  7. JohnD

    JohnD Guest

    Thanks for the idea, but I do want to have the versioning in the assembly. I
    can write a script to modify the web.config, It's just a bit of a pain
    that's all.

    /john.


    "S. Justin Gengo"
    <justin[remove-to-mail]@about-delete-to-mail-fortunate.com> wrote in message
    news:...
    > John,
    >
    > I don't know if it would work for you, but if you don't have applications
    > running old versions of your assembly then you could just hardcode the
    > version number in the assembly itself. Then even when revised the version
    > number would stay the same and you wouldn't have to change it ever.
    >
    > Of course if you need versioning of the assembly itself this won't work
    > for you at all.
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer
    >
    > Free code library at:
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzsche
    >
    >
    >
    >
    > "JohnD" <> wrote in message
    > news:%...
    >> Hi Sam,
    >>
    >> Thanks for the link, I'd seen that, but I was hoping that there was some
    >> magic syntax to allow me to "wildcard" some of the version information. I
    >> guess not.
    >>
    >> Thanks for you time and help.
    >>
    >> /john
    >>
    >> "Sam" <> wrote in message
    >> news:...
    >> On Dec 11, 1:35 am, "JohnD" <> wrote:
    >>> Hi Sam,
    >>>
    >>> Thanks, but not in this case I think. And it never occurred to me that
    >>> there
    >>> would be a difference. The assembly reference I have is actually a
    >>> language
    >>> provider in codedom, so the full fragment is:
    >>>
    >>> <system.web>
    >>> <compilation debug="true" batch="false">
    >>> <compilers>
    >>> <compiler language="lang" extension=".l"
    >>> type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    >>> />
    >>> </compilers>
    >>> </compilation>
    >>> </system.web>
    >>>
    >>> If I remove the version, or the entire assembly reference that I get a
    >>> "could not load assembly" exception.
    >>>
    >>> Thanks again.
    >>> /john
    >>>
    >>> "Sam" <> wrote in message
    >>>
    >>> news:...
    >>> On Dec 10, 5:19 am, "JohnD" <> wrote:
    >>>
    >>>
    >>>
    >>> > Hello all,
    >>>
    >>> > I have references to a number of my own assemblies in my web.config:
    >>>
    >>> > "type="A.B.C,ASS,Version=12.0.5.9786,Culture=neutral,PublicKeyToken=stuff"
    >>>
    >>> > Now, every time I create a new revision of my assembly (9786 becomes
    >>> > 9787
    >>> > for example) I need to change the text in my web.config file, which is
    >>> > a
    >>> > bit
    >>> > of a pain.
    >>>
    >>> > Is there any way to configure this so that the highest revision is
    >>> > always
    >>> > loaded? I've tried specfiying just 12.0.5, but that fails. I know I
    >>> > can
    >>> > use
    >>> > assembly redirection but that requires me to specify the new version
    >>> > number.
    >>> > I just want to replace the old assembly file with the new assembly
    >>> > file,
    >>> > and
    >>> > have it "just work".
    >>>
    >>> > Can it be done?
    >>>
    >>> > Thanks,
    >>>
    >>> > /john
    >>>
    >>> The version is optional, you do not have to specify the version number
    >>> in your 'type' statement, so don't include a version number.

    >>
    >> The 'compiler' element must have a fully qualified assembly name which
    >> includes the version:
    >> http://msdn.microsoft.com/en-us/library/y9x69bzw.aspx.
    >> Other elements like the 'add' for httpModules do not require fully
    >> qualified names and you can omit the version. So in your case you
    >> have no choice but to specifiy the version.

    >
    JohnD, Dec 12, 2008
    #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. Ily

    Assembly versioning

    Ily, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,305
    Brock Allen
    Apr 4, 2005
  2. Replies:
    0
    Views:
    676
  3. Coaster
    Replies:
    1
    Views:
    391
    Coaster
    Mar 16, 2007
  4. CSharpner
    Replies:
    0
    Views:
    1,023
    CSharpner
    Apr 9, 2007
  5. Adam Davidson

    Web Service Versioning Question

    Adam Davidson, Aug 14, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    132
    Erik P. Vinther
    Sep 8, 2003
Loading...

Share This Page