{"action":"closed","issue":{"url":"https://api.github.com/repos/daveaglick/Buildalyzer/issues/56","repository_url":"https://api.github.com/repos/daveaglick/Buildalyzer","labels_url":"https://api.github.com/repos/daveaglick/Buildalyzer/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/daveaglick/Buildalyzer/issues/56/comments","events_url":"https://api.github.com/repos/daveaglick/Buildalyzer/issues/56/events","html_url":"https://github.com/daveaglick/Buildalyzer/issues/56","id":332890616,"node_id":"MDU6SXNzdWUzMzI4OTA2MTY=","number":56,"title":".NET Framework builds failing in GetAssemblyVersion task","user":{"login":"daveaglick","id":1020407,"node_id":"MDQ6VXNlcjEwMjA0MDc=","avatar_url":"https://avatars2.githubusercontent.com/u/1020407?v=4","gravatar_id":"","url":"https://api.github.com/users/daveaglick","html_url":"https://github.com/daveaglick","followers_url":"https://api.github.com/users/daveaglick/followers","following_url":"https://api.github.com/users/daveaglick/following{/other_user}","gists_url":"https://api.github.com/users/daveaglick/gists{/gist_id}","starred_url":"https://api.github.com/users/daveaglick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daveaglick/subscriptions","organizations_url":"https://api.github.com/users/daveaglick/orgs","repos_url":"https://api.github.com/users/daveaglick/repos","events_url":"https://api.github.com/users/daveaglick/events{/privacy}","received_events_url":"https://api.github.com/users/daveaglick/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-15T19:33:30Z","updated_at":"2018-06-15T19:33:40Z","closed_at":"2018-06-15T19:33:40Z","author_association":"OWNER","body":"Builds are failing for .NET Framework projects:\r\n\r\n```\r\nProject \"E:\\Code\\Buildalyzer\\tests\\projects\\SdkFrameworkProject\\SdkFrameworkProject.csproj\" (Compile target(s)):\r\n\r\nTarget ResolveAssemblyReferences:\r\n    C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3088: Could not read state file \"obj\\Debug\\net462\\SdkFrameworkProject.csprojAssemblyReference.cache\". Exception has been thrown by the target of an invocation.\r\nDone building target \"ResolveAssemblyReferences\" in project \"SdkFrameworkProject.csproj\".\r\nTarget GenerateTargetFrameworkMonikerAttribute:\r\n  Skipping target \"GenerateTargetFrameworkMonikerAttribute\" because all output files are up-to-date with respect to the input files.\r\nTarget ResolveCodeAnalysisRuleSet:\r\n    C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\Microsoft.CSharp.CurrentVersion.targets(134,9): warning MSB3884: Could not find rule set file \"ManagedMinimumRules.ruleset\".\r\nDone building target \"ResolveCodeAnalysisRuleSet\" in project \"SdkFrameworkProject.csproj\".\r\nTarget GetAssemblyVersion:\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018: The \"GetAssemblyVersion\" task failed unexpectedly.\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GetAssemblyVersion.ExecuteCore()\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute()\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()\r\n    C:\\Program Files\\dotnet\\sdk\\2.1.300\\Sdks\\Microsoft.NET.Sdk\\targets\\Microsoft.NET.GenerateAssemblyInfo.targets(161,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()\r\nDone building target \"GetAssemblyVersion\" in project \"SdkFrameworkProject.csproj\" -- FAILED.\r\n\r\nDone building project \"SdkFrameworkProject.csproj\" -- FAILED.\r\n\r\nBuild FAILED.\r\n```\r\n\r\nI'm still not totally sure why this target is having problems, but after some research it looks like we can turn off the `ResolveAssemblyReference` cache with the property `DisableRarCache` (see https://github.com/Microsoft/msbuild/commit/331cd4a4042be80064e4a89811b23771e6b09409) and that seems to fix the issue. This is also apparently what VS does for design-time builds. I suspect it has something to do with the way the RAR cache file name is generated, but not going to spend more time on it."}}
{"actor":{"display_login":"daveaglick"}}