AssemblyInfo patching not working for one project in a solution

james's Avatar

james

10 May, 2014 01:25 PM

I'm using the AssemblyPatching feature for a set of NuGet packages on this project but one of the projects (JamesDibble.Extensions.System) does not have its version information updated. I have tried recreating the project several times and diffed it with the projects that are working but it hasn't made a difference. Is there anything specific that would prevent this from happening? It wouldn't be a massive problem but it is preventing automatic deployment to NuGet as the package versions are the same.

  1. Support Staff 1 Posted by Feodor Fitsner on 10 May, 2014 07:10 PM

    Feodor Fitsner's Avatar

    Is there a standard AssemblyInfo.cs? Could you paste it's contents please?

    - Feodor

  2. 2 Posted by james on 10 May, 2014 07:22 PM

    james's Avatar

    It should be. It came from the standard C# library project. Here's the file

  3. Support Staff 3 Posted by Feodor Fitsner on 10 May, 2014 07:23 PM

    Feodor Fitsner's Avatar

    Thanks, I will take a look what's wrong.

  4. Support Staff 4 Posted by Feodor Fitsner on 14 May, 2014 06:50 PM

    Feodor Fitsner's Avatar

    Hi James,

    I'm trying to reproduce the issue and that Assemblyinfo.cs is getting patched:
    https://ci.appveyor.com/project/appvyr/jamesdibbleassemblies/build/...

  5. Support Staff 5 Posted by Feodor Fitsner on 14 May, 2014 06:50 PM

    Feodor Fitsner's Avatar

    Hey, and thanks for writing about AppVeyor in your blog! ;)

  6. 6 Posted by james on 14 May, 2014 07:28 PM

    james's Avatar

    Ok, this a bit odd then. If you take the (Nuget package)[https://ci.appveyor.com/api/buildjobs/kpqvrksrfmcaglwk/artifacts/Ja...] from the latest build, extract it and check the AssmbleyFileInfo version it says 1.0.0.0 in it still, which is why the Nuget package gets version accordingly. I had an AppVeyor project on the same repository with identical settings that worked as expected ONCE, then reverted back to putting 1.0.0.0 even though no changes had been made to either the .csproj, AssemblyInfo.cs, .nuspec before it worked, on the build it worked, or the subsequent build it stopped working again.

    Is this a side affect in another part of the build somehow and like your demonstration project shows, the AssemblyInfo is being patched but not being adhered to when it hits MsBuild?

    What was the script you ran in your demonstration and could I run it on my project to check we're getting the same results?

    And no problem, thanks for reading :)

  7. Support Staff 7 Posted by Feodor Fitsner on 14 May, 2014 07:30 PM

    Feodor Fitsner's Avatar

    Well, I enabled assembly patching through UI, no appveyor.yml there. Will do that with appveyor.yml and let you know about the results.

  8. Support Staff 8 Posted by Feodor Fitsner on 14 May, 2014 07:37 PM

    Feodor Fitsner's Avatar
  9. 9 Posted by james on 14 May, 2014 07:52 PM

    james's Avatar

    I get same the same (result)[https://ci.appveyor.com/project/james-dibble/jamesdibbleassemblies/...] which is ALWAYS good.

    It must be the NuGet packaging as you say. Any suggestions looking at the (.nusepc file)[https://github.com/james-dibble/JamesDibbleAssemblies/blob/master/E...]? It's about as basic as they get and all the other packages in the solution using a very similar format work fine.

  10. Support Staff 10 Posted by Feodor Fitsner on 14 May, 2014 08:01 PM

    Feodor Fitsner's Avatar

    I think the problem is that $version$ variable is getting expanded when you package VS project like nuget something.csproj (this case nuget knows the assembly to extract version from). If you do package nuget my.nuspec then $version$ variable should be provided by you.

  11. 11 Posted by james on 14 May, 2014 08:43 PM

    james's Avatar

    We were right about it being the NuGet packaging, but not for any good reason!

    Some of the other .csproj files were dependent on the Extenstions.System dll so in one of my weirder moments I must have decided to use NuGet to get the dependency rather that use the local project. Coincidentally, this made the solution download a REALLY old version of the dll from NuGet and put it in the output directory which was then picked up when trying to build the new NuGet package for the same dll, hence why the assemblyinfo patching was working fine, but the artefacts being build had totally different versions.

    Everything working great now. User error!

    Thanks for all your help.

  12. james closed this discussion on 14 May, 2014 08:43 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Jun, 2025 08:45 PM
18 Jun, 2025 04:23 PM
13 Jun, 2025 04:36 PM
13 Jun, 2025 04:27 PM
13 Jun, 2025 07:20 AM

 

10 Jun, 2025 01:56 AM
09 Jun, 2025 07:11 PM
04 Jun, 2025 04:08 PM
27 May, 2025 05:48 PM
27 May, 2025 06:37 AM
27 May, 2025 06:31 AM