I need two things out of an assembly I'm developing, and they seem to be at odds:
- Bake the compile time into the version number
- Offer a web part that won't go stale every time I deploy
I'm using [assembly: AssemblyVersion("1.0.*")]
to bake the compile time into the assembly (so that I can format it and display it later). That changes the last two numbers in the assembly version every time I compile.
When I add to my page a Web Part that's in this assembly, it seems to become invalid after future deployments, b/c the version number of the assembly is always changing automatically. The error message is similar to (italic text is simulated):
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type Namespace1.Namespace2.AssemblyName.AssemblyName, Namespace1.Namespace2, Version=1.0.4454.15790, Culture=neutral, PublicKeyToken=2d5b72b5e35faf73 could not be found or it is not registered as safe.
How can I use this feature of AssemblyVersion
w/o having to re-add to my page all of this assembly's Web Parts each time the version number automatically changes?
[assembly: AssemblyVersion("1.0.*")]
)