Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change version strategy in V4 to set AssemblyVersion #3335

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

normj
Copy link
Member

@normj normj commented Jun 6, 2024

V3 we always set the AssemblyVersion because the version number is part of the assembly identity. If you change the version number any assemblies that depend on have to recompile for the new version. This strategy dated back to when the SDK only targeted .NET Framework.

In .NET Core the version number is not part of the assembly identity so users are not required to recompile. This PR changes the strategy for .NET Core set the AssemblyVersion to the same value of AssemblyFileVersion. For the .NET Framework targets we continue to use the same strategy.

Example of a generated `AssemblyInfo.cs

using System;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AWSSDK.AmplifyBackend")]
#if BCL
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (4.6.2) - AmplifyBackend. (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app.")]
#elif NETSTANDARD20
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (NetStandard 2.0) - AmplifyBackend. (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app.")]
#elif NETCOREAPP3_1
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (.NET Core 3.1) - AmplifyBackend. (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app.")]
#elif NET8_0
[assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (.NET 8.0) - AmplifyBackend. (New Service) The Amplify Admin UI offers an accessible way to develop app backends and manage app content. We recommend that you use the Amplify Admin UI to manage the backend of your Amplify app.")]
#else
#error Unknown platform constant - unable to set correct AssemblyDescription
#endif

[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Amazon Web Services SDK for .NET")]
[assembly: AssemblyCompany("Amazon.com, Inc")]
[assembly: AssemblyCopyright("Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
#if BCL
[assembly: AssemblyVersion("3.3")]
#else
[assembly: AssemblyVersion("3.7.300.84")]
#endif
[assembly: AssemblyFileVersion("3.7.300.84")]

@normj normj requested a review from boblodgett June 6, 2024 06:33
…mblyFileVersion in non .NET Framework targets.

In .NET Core the AssemblyVersion is not used as part of the identity of the strong named assembly.
@normj normj force-pushed the normj/set-version branch from 57feb40 to 585cdd3 Compare June 6, 2024 06:34
@dscpinheiro dscpinheiro added the v4 label Jun 6, 2024
@dscpinheiro dscpinheiro self-requested a review June 6, 2024 17:27
Copy link
Contributor

@boblodgett boblodgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look like they will work. I am running them through the build system with my changes to ensure everything works correctly.

@boblodgett boblodgett merged commit fa6114d into v4-development Jun 10, 2024
2 checks passed
@boblodgett boblodgett deleted the normj/set-version branch June 10, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants