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
Satellite assemblies omit assembly version attributes, only under dotnet build
#1276
Comments
IMO the A possible workaround for this might be to let the .NET SDK .targets generate these version attributes in the primary assembly and thus it would know to generate them in the resource assemblies as well. However there is a concern with that approach. And really before Nerdbank.GitVersioning can stop generating these attributes, it needs to be able to be sure the attributes will be generated by the .NET SDK itself. But until #534 is fixed (and broadly used) there may not be a way for NB.GV to be able to detect this. |
Here's another repro:
|
@AArnott does the build log indicate that the This target both generated the For #1255 i split this target and the attributes are generated by |
This isn't a matter of a target skipping. The primary output assembly got the version info correctly. The issue is related to the fact that I disable the default version attribute generating targets using the supported msbuild property for that purpose and I generate my own attributes. But while that works with full msbuild, with msbuild core (which may be lacking AL.exe?) my attributes aren't picked up and used for the satellite assembly. |
@AArnott it is not clear to me what is the "special" sauce in your repo that causes this to happen? Can you help us reach a more straight forward repro for this? Other than clone and repo and try it? |
Sure: install the Nerdbank.GitVersioning nuget package to a brand new project. Then of course add a strings.es.resx file to your project so that it actually has a satellite assembly to build. That should be all you need. |
@livarcocc The key point is that |
There is no AL.exe for .NET Core. The better fix would be to retrieve the version info from the main assembly and send that on to Csc. We need to push in the opposite direct IMHO: get rid of AL.exe in desktop msbuild as well, and use Csc everywhere. I think that should be done in the common resource targets and we should delete the overriding of satellite assembly generation from this repo. This approach would close dotnet/msbuild#1490 It would also allow satellite assemblies to be |
That would suit me fine. |
Bump? Can either this or dotnet/msbuild#1490 be repriorized as required for 2.0? This scenario is broken for the CLI with only msbuild.exe as a workaround. |
Ok, let's first fix this in sdk, then push to have our targets moved to msbuild in vnext. |
Repro steps
Expected
The built satellite assemblies have an assembly version that matches the one in the primary output assembly.
Actual
The built satellite assemblies lack any version attributes, leaving the assemblies claiming a version of 0.0.0.0.
The detailed build log from
dotnet build
includes this relevant portion:When using msbuild.exe instead of
dotnet build
, I get the expected behavior:This produces properly versioned satellite assemblies. We see in the detailed build logs this time that instead of using csc.exe to generate them, the targets use AL.exe, which uses the version from the primary assembly explicitly as a template:
This was originally reported dotnet/Nerdbank.GitVersioning#131, discovered by @onovotny.
The text was updated successfully, but these errors were encountered: