-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Generated AssemblyInfo.cs file should be regenerated after package restore #1142
Comments
Thanks for the tip about |
That doesn't resolve the issue. Probably because the .targets file in my package cache is older than the generated assemblyinfo.cs file, so MSBuild considers that it doesn't invalidate the generated file. |
If restore changed the targets that are imported, then the file restore generates with imports from packages should have changed. Does that not put itself in MSBuildAllProjects? |
Yes, my package does (now) add the .targets to MSBuildAllProjects. But MSBuild does not track changes to the set of projects in that property, so that doesn't matter to MSBuild. What does matter for MSBuild's own Target Inputs/Outputs attributes is whether any file specified in Inputs is newer than any file specified in Outputs. And as I said in my last comment, unless package restore actually unpacked NB.GV for the first time, then the .targets file will be older than your last generated source file, so it still won't regenerate. |
@AArnott I understand that, but I am referring to the contents of obj\SomeProject.nuget.g.targets that restore generates to pull in SomePackage.targets, not to SomePackage.targets itself. AFAICT, any change to what's imported via packages will cause changes to *.nuget.g.(props|targets) to change during restore. If you start using a package with targets, then the import will be written for the first time. If you stop using it, the import will be deleted. Even if you just change versions, it will still change because the path includes the version. I just checked and *.nuget.g.(props|targets) do include themselves in MSBuildAllProjects. I'm missing why that doesn't solve the issue... |
Oh I see. Then yes, I guess I'd be puzzled by that as well -- unless the very build that is |
Reproducing for vsts build solution task with csproj vnext. |
@Bakanych can you share a binary log ( the 2.0.0+ SDKs should now detect changes to the attribute values for incremental builds. |
@dasMulli |
I'm using incremental builds having |
Any chance you can repro this locally and provide some logs to us, or maybe a repro? I will be nearly impossible to tell what might be going on otherwise. Also, can you share what version of the .NET Core SDK you have installed in your box? |
…0191128.4 (dotnet#1142) - Microsoft.AspNetCore.Analyzers - 5.0.0-alpha1.19578.4 - Microsoft.AspNetCore.Mvc.Api.Analyzers - 5.0.0-alpha1.19578.4 - Microsoft.AspNetCore.Mvc.Analyzers - 5.0.0-alpha1.19578.4 - Microsoft.AspNetCore.Components.Analyzers - 5.0.0-alpha1.19578.4
Due to lack of recent activity, this issue has been labeled as 'stale'. It will be closed if no further activity occurs within 30 more days. Any new comment will remove the label. |
This issue will now be closed since it has been labeled 'stale' without activity for 30 days. |
Incremental build is buggy. If a user installs Nerdbank.GitVersioning into a .netstandard project in VS2017 after the assemblyinfo.cs was generated in the obj directory, the user will get build errors until they delete the file.
I've hit this so many times, and @asherber just reported it as well: dotnet/Nerdbank.GitVersioning#121
Please regenerate the file on each build, or delete it as part of package restore.
You can keep CoreCompile skipping behavior while still generating this intermediate source file on each build the same way you do for project.lock.json: generate the file elsewhere and then only copy it over the original file if the contents are not equivalent
.
The text was updated successfully, but these errors were encountered: