VS2022 winform project and AssemblyInfo.cs file missing

T.Zacks 3,996 Reputation points
2022-03-16T08:08:31.747+00:00

i used to work with VS2013 before and there was AssemblyInfo.cs file exist in project where we mention project version and many other things.

here i am giving a content of AssemblyInfo.cs file of my old project

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("MyProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("My Company")]
[assembly: AssemblyProduct("MyProject")]
[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("8e128185-dcf8-4f3d-9e21-e4e7bbbd7cbd")]

// 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("1.0.5.25")]
[assembly: AssemblyFileVersion("1.0.5.25")]

when i have created a winform .net core project with VS2022 IDE then i found no AssemblyInfo.cs file in project.

so tell me in .net core winform project where i can mention my

  1. project name
  2. company name
  3. project version ?

before this was i used to project version from AssemblyInfo.cs file this.Text = "My Project (New) " + Assembly.GetExecutingAssembly().GetName().Version;

1) please tell me where i can mention my project name, company name and version info when working with VS2022 & .net core?
2) how to read project version using c# code.

thanks

Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2022-03-16T09:30:58.52+00:00

    These are under Package Tab.

    183663-f1.png

    Note the information is stored in each project file e.g.

    <Project Sdk="Microsoft.NET.Sdk">  
      
     <PropertyGroup>  
     <AssemblyVersion>2.0.0.0</AssemblyVersion>  
     <FileVersion>2.0.0.0</FileVersion>  
     <Authors>Karen Payne</Authors>  
     <Product>Demo</Product>  
     <Description>Code sample</Description>  
     <Copyright>Use as you like</Copyright>  
     </PropertyGroup>  
    

    Get App Version in .NET Core


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.