Assembly versioning in web.config

J

JohnD

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
 
S

Sam

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.
 
J

JohnD

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



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.
 
S

Sam

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







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.
 
J

JohnD

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

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







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

S. Justin Gengo

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
 
J

JohnD

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"
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top