1

I created a setup project in visual studio 2010 ultimate edition like this

File -> New -> Project -> Visual Studio Installer -> Setup Wizard -> ok

I did not get AssemblyInfo.cs file, not sure from where to get it. I need this file to auto-increment MSI version. Could you let me know how to get this file or how to auto-increment MSI version for each build.

I tried all solutions from stackoverflow, but nothing worked. Please check this below screenshot

Setup Solution Explorer

Kalyan Kumar
  • 399
  • 3
  • 14

1 Answers1

0

Edit

Check this answer: Set AssemblyInfo Version numbers with MSI setup version

The info below is not for Setup Projects

Here is a sample:

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

// 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("Title")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Product")]
[assembly: AssemblyCopyright("Copyright ©  2019")]
[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)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("12345678-aaaa-bbbb-cccc-123456789012")]

// 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.*")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]

Don't forget, you have to generate your unique GUID (assembly: Guid)

You should put it in the project folder and edit your .csproj file.

This code block should be added:

<ItemGroup>
    <Compile Include="AssemblyInfo.cs" />
</ItemGroup>

Usually, this file is in the subfolder "Properties"

<ItemGroup>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Tolbxela
  • 4,767
  • 3
  • 21
  • 42