monodevelop icon indicating copy to clipboard operation
monodevelop copied to clipboard

[gtk2] Update templates to Gtk# 2.12

Open directhex opened this issue 7 years ago • 5 comments

Real talk: Gtk# 2.6 shipped in 2005, and we don't support 2.4.

This should fix Gtk#2 projects going screwy if you have Gtk#3 installed

directhex avatar Jun 25 '18 15:06 directhex

It seems even with the changes in this PR, it doesn't force 2.12. The version bumping is unbeatable.

  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>gtk-sharp-2.0</Package>
    </Reference>
    <Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>gtk-sharp-2.0</Package>
    </Reference>
    <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>glib-sharp-2.0</Package>
    </Reference>
    <Reference Include="glade-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>glade-sharp-2.0</Package>
    </Reference>
    <Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>gtk-sharp-2.0</Package>
    </Reference>
    <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
      <Package>gtk-sharp-2.0</Package>
    </Reference>
    <Reference Include="Mono.Posix" />
  </ItemGroup>
/usr/lib/mono/4.5/csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:DEBUG /errorendlocation /preferreduilang:en-GB /highentropyva+ /reference:/usr/lib/mono/gac/atk-sharp/3.0.0.0__35e10195dab3c99f/atk-sharp.dll /reference:/usr/lib/mono/gac/gdk-sharp/3.0.0.0__35e10195dab3c99f/gdk-sharp.dll /reference:/usr/lib/mono/gac/glade-sharp/2.12.0.0__35e10195dab3c99f/glade-sharp.dll /reference:/usr/lib/mono/gac/glib-sharp/3.0.0.0__35e10195dab3c99f/glib-sharp.dll /reference:/usr/lib/mono/gac/gtk-sharp/3.0.0.0__35e10195dab3c99f/gtk-sharp.dll /reference:/usr/lib/mono/4.7-api/Mono.Posix.dll /reference:/usr/lib/mono/4.7-api/mscorlib.dll /reference:/usr/lib/mono/gac/pango-sharp/3.0.0.0__35e10195dab3c99f/pango-sharp.dll /reference:/usr/lib/mono/4.7-api/System.Core.dll /reference:/usr/lib/mono/4.7-api/System.dll /debug+ /debug:portable /optimize- /out:obj/x86/Debug/button4.exe /subsystemversion:6.00 /resource:gtk-gui/gui.stetic,gui.stetic /target:winexe /utf8output gtk-gui/generated.cs MainWindow.cs gtk-gui/MainWindow.cs Program.cs Properties/AssemblyInfo.cs "/tmp/.NETFramework,Version=v4.7.AssemblyAttributes.cs"

Looking at the msbuild log, it seems MD is always resolving from GAC, not from pkg-config, and ignoring the exact version requirement.

directhex avatar Jun 25 '18 16:06 directhex

... because msbuild doesn't support pkg-config, but xbuild does. msbuild on the csproj fails, xbuild on the csproj is fine.

directhex avatar Jun 25 '18 16:06 directhex

@radical this seems bigger than it first appeared, you're the domain expert.

Summary: xbuild resolves from PkgConfig (a custom search path location in Mono Microsoft.Build.Tasks), and returns the specified assembly version. msbuild doesn't support PkgConfig resolver, and also ignores specific version requests in favour of $LATEST found in GAC. How to fix?

directhex avatar Jun 25 '18 16:06 directhex

Is this just for these specific templates? You could try <Reference Include="gtk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" HintPath="$(MSBuildBinPath)\..\..\..\gtk-sharp-2.0\gtk-sharp.dll"> .

radical avatar Jun 25 '18 19:06 radical

@radical it looks like adding a <HintPath /> to the csproj does indeed fix it, both with msbuild on the command line and in the IDE. It's unfortunate that the HintPath is distribution-specific though, so it breaks the ability to open projects on Ubuntu created in SUSE

I guess we need to add that to the IDE's pkg-config reference handling code?

directhex avatar Jul 16 '18 17:07 directhex