Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Framework builds failing in GetAssemblyVersion task #56

Closed
daveaglick opened this issue Jun 15, 2018 · 1 comment
Closed

.NET Framework builds failing in GetAssemblyVersion task #56

daveaglick opened this issue Jun 15, 2018 · 1 comment

Comments

@daveaglick
Copy link
Collaborator

Builds are failing for .NET Framework projects:

Project "E:\Code\Buildalyzer\tests\projects\SdkFrameworkProject\SdkFrameworkProject.csproj" (Compile target(s)):

Target ResolveAssemblyReferences:
    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.
Done building target "ResolveAssemblyReferences" in project "SdkFrameworkProject.csproj".
Target GenerateTargetFrameworkMonikerAttribute:
  Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
Target ResolveCodeAnalysisRuleSet:
    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".
Done building target "ResolveCodeAnalysisRuleSet" in project "SdkFrameworkProject.csproj".
Target GetAssemblyVersion:
    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.
    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.
    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()
    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()
    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()
    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()
Done building target "GetAssemblyVersion" in project "SdkFrameworkProject.csproj" -- FAILED.

Done building project "SdkFrameworkProject.csproj" -- FAILED.

Build FAILED.

I'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 dotnet/msbuild@331cd4a) 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.

@daveaglick
Copy link
Collaborator Author

This is resolved in the most recent commit.

daveaglick added a commit that referenced this issue Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant