coapp / coapp.powershell

ClrPlus Signing
52 stars 43 forks source link

"Referenced Packages" property sheets are not updated when reinstalling packages #28

Open yodantauber opened 10 years ago

yodantauber commented 10 years ago

Steps to reproduce:

  1. Create a package from the attached autopkg script and put it in your package source.
  2. Create a new VC++ project.
  3. Install the PropertySheetBug package into the project.
  4. Go to the property pages of the project, and see that there is no "Referenced Packages" section, as expected.
  5. Uncomment all commented lines in the autopkg script and recreate the package. Update the package source (with the same version number).
  6. Go to the Package Manager Console in Visual Studio and type: Update-Package PropertySheetBug -reinstall. Examine output to make sure the package was successfully uninstalled and then installed again.
  7. Go to the property pages of the project.

Expected: there is now a "Referenced Packages" section with the "Something" property from the package. Actual: there is still no such section.

Note that this only seems to happen when keeping the same version number and using the -reinstall switch (which is common while developing a package).

yodantauber commented 10 years ago

And now the promised autopkg script:

configurations {
    //Something {
    //  choices : { X1, X2};
    //};
}

nuget {
    nuspec {
        id = PropertySheetBug;
        version : 1.0.1;
        title: Property Sheet Bug;
        tags: { native };

        projectUrl: "http://www.example.com";
        iconUrl: "http://www.example.com";
        licenseUrl: "http://www.example.com";
        releaseNotes: "";
        description: "Property Sheet Bug";
    };

    files {
        //[X1] { 
            lib: 1.lib;
        //}
        //[X2] { 
            lib: 2.lib;
        //}
    };
}
fearthecowboy commented 10 years ago

I'm pretty sure this is Visual Studio's fault. It tries to cache so much, that it breaks a ton when doing stuff like this.

Working around it's cache-ignorance is why the generated PropertyPageSchema xml files are names with GUIDs (which when you move from version to version, would at least force it to reload).

I think VS doesn't notice if you stop referencing a PropertyPageSchema xml ... I dunno what I could do about that.

yodantauber commented 10 years ago

What if a new GUID was generated whenever a package is created, even if nothing changes?

fearthecowboy commented 10 years ago

Well, I think the exact problem here, is that VS (or parts of VS) doesn't realize that the <Import>ed .targets file has even changed (and hence won't go and re-evaluate the PPS xml files)

and since --reinstall doesn't physically change the <Import> I don't even know if there is any way to kick it to check. I never found one when I was experimenting. (The VC++ folks were pretty sheepish when I mentioned this :D )

gordonwatts commented 10 years ago

I've created NuGet packages in the past, btw, that create Import packages, and I've had this exact problem. Very frustrating. Didn't figure out a way to fix it. :-)