assemblyinfo

Do I need AssemblyInfo while working with .NET Core?

依然范特西╮ 提交于 2019-12-02 22:13:44
Previously, AssemblyInfo.cs file was autocreated by Visual Studio to contain assembly-wide attributes, like AssemblyVersion, AssemblyName and so on. In .NET Core and ASP.NET Core, project.json is responsible for holding most of that information. So the question is: do I need to mark my assemblies with that attributes anymore? What traps can I get in if I will not mark assembly with that attributes? Set project.json has replaced the AssemblyInfo . AssemblyVersionAttribute is replaced by version property version Type: String The Semver version of the project, also used for the NuGet package.

Visual Studio 2017 and the new .csproj InternalsVisibleTo

心不动则不痛 提交于 2019-12-02 19:02:25
Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file? To clarify Hans Passant's comment above, you simply have to add InternalsVisibleTo to any cs file in your project. For example, I created an AssemblyInfo.cs file in the root of the project and then added the following content (only): using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=<ADD_KEY_HERE>")] Just in case anyone would like to put InternalsVisibleTo within a .csproj file instead of AssemblyInfo.cs ( a possible scenario is to have

Should AssemblyInfo.cs be placed in version control?

拥有回忆 提交于 2019-12-02 17:36:24
I have an automated build system using CruiseControl. I am using the SvnRevisionLabeller to to get the version string to use. With this string I can use nant to update AssemblyInfo.cs so when I build it has the correct build string. I can also use this CC label to tag the subversion repository. So everything is aligned - CCNet Build label - Executable (Assembly Information) - Version Control (subverson tag) Now where I have a problem is if I want to try to rebuild an old image from the repository. Since AssemblyInfo.cs is not under version control but rather a generated file, when I now try to

How to update the Value in Assemblyinfo.cs dynamically

怎甘沉沦 提交于 2019-11-30 14:16:51
I have writen a program which gets the value from SVN repository . Now I want to update the AssemblyFileversion with that value. As I am not able to write any code inside Assemblyinfo.cs , how will I update the value of AssemblyFileVersion. I want to achieve something like this .......................... // 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:

AssemblyInfo.cs subversion and TortoiseSVN

此生再无相见时 提交于 2019-11-30 01:12:54
I'm using TortoiseSVN and Visual Studio 2008. Is there any way to update my project's assemblyinfo.cs with svn's version in every build? For example, 1.0.0.[svn's version] -> 1.0.0.12 You could use the SubWCRev tool which comes with TortoiseSVN (also available separately). Either run it from a command line or use the COM-Object it offers. The SubWCRev command line tool replaces keywords inside a file with information from your svn working copy. An example is shown in the docs. I do this in my build script : <SvnInfo LocalPath="."> <Output TaskParameter="Revision" PropertyName="BuildRev" /> <

Get minor and major version from MSBUILD script

蹲街弑〆低调 提交于 2019-11-29 00:06:03
I'm using Msbuild to compile and generate .zip files and installers and I need the version number of my assembyInfo. I'm using this code. <Target Name="getversion"> <GetAssemblyIdentity AssemblyFiles="$(BuildDir)\myprogram.exe"> <Output TaskParameter="Assemblies" ItemName="fooAssemblyInfo"/> </GetAssemblyIdentity> <Message Text="Version = %(fooAssemblyInfo.Version)"/> </Target> But this returns Version = 2.0.0.29110, I need just the minor and major version. Is there any way to read the assembyInfo.cs information without a custom task? Finally I have used this code that not require additional

AssemblyInfo.cs subversion and TortoiseSVN

故事扮演 提交于 2019-11-28 21:18:54
问题 I'm using TortoiseSVN and Visual Studio 2008. Is there any way to update my project's assemblyinfo.cs with svn's version in every build? For example, 1.0.0.[svn's version] -> 1.0.0.12 回答1: You could use the SubWCRev tool which comes with TortoiseSVN (also available separately). Either run it from a command line or use the COM-Object it offers. The SubWCRev command line tool replaces keywords inside a file with information from your svn working copy. An example is shown in the docs. 回答2: I do

Assembly Versioning using CruiseControl.net

时光怂恿深爱的人放手 提交于 2019-11-28 18:27:38
I have setup CruiseControl.net for a bunch of my projects which are related. As a result a single project tag in CruiseControl has multiple SVN checkouts and then a bunch of msbuild tasks compile all the individual sln files. I need to update the assembly version of all the solutions when this build is being done. However, since i'm not using nant and not using MSBuild proj files, I am unsure on how to get this. I wonder if I'm missing something obvious. I just need a solution which can be implemented by making appropriate changes in the ccnet.config file without requiring me to make changes

What are the best practices for using Assembly Attributes?

喜夏-厌秋 提交于 2019-11-28 14:55:32
I have a solution with multiple project. I am trying to optimize AssemblyInfo.cs files by linking one solution wide assembly info file. What are the best practices for doing this? Which attributes should be in solution wide file and which are project/assembly specific? Edit: If you are interested there is a follow up question What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? JRoppert We're using a global file called GlobalAssemblyInfo.cs and a local one called AssemblyInfo.cs. The global file contains the following attributes: [assembly:

C# Project Global AssemblyInfo

匆匆过客 提交于 2019-11-28 09:54:23
NET 3.5 solution with multiple projects in it. Is there a way I can create a "Global" AssemblyInfo.cs in which all the project AssemblyInfo.cs can reference from? Create AssemblyInfoInc.cs somewhere in the root of your solution, add global attributes there and add as link to each project. File Add Dialog: 来源: https://stackoverflow.com/questions/2732155/c-sharp-project-global-assemblyinfo