{"action":"closed","issue":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/662","labels_url":"https://api.github.com/repos/GitTools/GitVersion/issues/662/labels{/name}","comments_url":"https://api.github.com/repos/GitTools/GitVersion/issues/662/comments","events_url":"https://api.github.com/repos/GitTools/GitVersion/issues/662/events","html_url":"https://github.com/GitTools/GitVersion/issues/662","id":109689844,"number":662,"title":"Documentation is wrong - ","user":{"login":"Pitterling","id":4181164,"avatar_url":"https://avatars.githubusercontent.com/u/4181164?v=3","gravatar_id":"","url":"https://api.github.com/users/Pitterling","html_url":"https://github.com/Pitterling","followers_url":"https://api.github.com/users/Pitterling/followers","following_url":"https://api.github.com/users/Pitterling/following{/other_user}","gists_url":"https://api.github.com/users/Pitterling/gists{/gist_id}","starred_url":"https://api.github.com/users/Pitterling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pitterling/subscriptions","organizations_url":"https://api.github.com/users/Pitterling/orgs","repos_url":"https://api.github.com/users/Pitterling/repos","events_url":"https://api.github.com/users/Pitterling/events{/privacy}","received_events_url":"https://api.github.com/users/Pitterling/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GitTools/GitVersion/labels/documentation","name":"documentation","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-04T16:26:04Z","updated_at":"2015-10-11T23:51:20Z","closed_at":"2015-10-11T23:51:20Z","body":"http://gitversion.readthedocs.org/en/latest/usage/#msbuild-task says\r\n\r\n>Ensure you remove the Assembly*Version attributes from your Properties\\AssemblyInfo.cs file so as to not get duplicate attribute warnings. Sample default:\r\n```c#\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyInformationalVersion(\"1.1.0+Branch.master.Sha.722aad3217bd49a6576b6f82f60884e612f9ba58\")]\r\n\r\nIn fact you need to have these attributes in the AssemblyInfo.cs file otherwise they will not be set. Data is just replaced by Regex and not created if it does not exist.\r\n\r\nAssemblyInfoFileUpdate.cs --> public AssemblyInfoFileUpdate\r\n```c#\r\nvar fileContents = fileSystem.ReadAllText(assemblyInfoFile)\r\n                    .RegexReplace(@\"AssemblyVersion\\(\"\"[^\"\"]*\"\"\\)\", string.Format(\"AssemblyVersion(\\\"{0}\\\")\", assemblyVersion))\r\n                    .RegexReplace(@\"AssemblyInformationalVersion\\(\"\"[^\"\"]*\"\"\\)\", string.Format(\"AssemblyInformationalVersion(\\\"{0}\\\")\", assemblyInfoVersion))\r\n                    .RegexReplace(@\"AssemblyFileVersion\\(\"\"[^\"\"]*\"\"\\)\", string.Format(\"AssemblyFileVersion(\\\"{0}\\\")\", assemblyFileVersion));\r\n\r\n\r\n"}}