diff --git a/ILRepack.IntegrationTests/ILRepack.IntegrationTests.csproj b/ILRepack.IntegrationTests/ILRepack.IntegrationTests.csproj index 200dea07..5103d288 100644 --- a/ILRepack.IntegrationTests/ILRepack.IntegrationTests.csproj +++ b/ILRepack.IntegrationTests/ILRepack.IntegrationTests.csproj @@ -9,8 +9,9 @@ Properties ILRepack.IntegrationTests ILRepack.IntegrationTests - v4.0 + v4.7.2 512 + true @@ -20,6 +21,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -28,6 +30,7 @@ TRACE prompt 4 + false @@ -83,6 +86,15 @@ 2.6.4 + + 2.6.4 + + + 2.3.0 + + + 2.0.0 + 2.2.5 diff --git a/ILRepack.IntegrationTests/NuGet/NuGetHelpers.cs b/ILRepack.IntegrationTests/NuGet/NuGetHelpers.cs index 4368877b..f81e047d 100644 --- a/ILRepack.IntegrationTests/NuGet/NuGetHelpers.cs +++ b/ILRepack.IntegrationTests/NuGet/NuGetHelpers.cs @@ -60,6 +60,8 @@ public static IObservable>> GetNupkgAssembliesAsync(P public static IObservable>> GetNupkgContentAsync(Package package) { + // can't download from nuget.org without Tls12 anymore, net472 is needed for Tls12 + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; var o = CreateDownloadObservable(new Uri($"https://www.nuget.org/api/v2/package/{package.Name}/{package.Version}")); return o.SelectMany(input => { return Observable.Create>(observer => { diff --git a/ILRepack.IntegrationTests/Scenarios.cs b/ILRepack.IntegrationTests/Scenarios.cs index 76335a42..e52b1a5f 100644 --- a/ILRepack.IntegrationTests/Scenarios.cs +++ b/ILRepack.IntegrationTests/Scenarios.cs @@ -53,6 +53,18 @@ public void GivenDotNet462AppUsingNetStandard2LibrarySetAndReflection_MergedAppl RunScenario("DotNet462NetStandard2"); } + [Test] + public void GivenNetCore3WinFormsAppUsesImageResources_MergedCore3WinFormsApplicationRunsSuccessfully() + { + RunScenario("WindowsFormsTestNetCoreApp"); + } + + [Test] + public void GivenNetCore3WpfAppUsesImageResources_MergedCore3WpfApplicationRunsSuccessfully() + { + RunScenario("WPFSampleApplicationCore"); + } + private void RunScenario(string scenarioName) { string scenarioExecutable = GetScenarioExecutable(scenarioName); diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibrary/packages.config b/ILRepack.IntegrationTests/Scenarios/ClassLibrary/packages.config new file mode 100644 index 00000000..7547653d --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibrary/packages.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/ClassLibraryCore.csproj b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/ClassLibraryCore.csproj new file mode 100644 index 00000000..ee177907 --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/ClassLibraryCore.csproj @@ -0,0 +1,33 @@ + + + + netcoreapp3.1 + true + true + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + + diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml new file mode 100644 index 00000000..37172f95 --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml @@ -0,0 +1,14 @@ + + + /ClassLibraryCore;component/Resources/image.png + + + + + + + + diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml.cs b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml.cs new file mode 100644 index 00000000..d32e3fa2 --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/DummyUserControl.xaml.cs @@ -0,0 +1,31 @@ + +using System; +using System.Windows; + +namespace ClassLibraryCore +{ + public partial class DummyUserControl + { + public DummyUserControl() + { + InitializeComponent(); + + Loaded += OnLoaded; + + if (Properties.Resources.image.Size.Width <= 0) + { + throw new Exception("Image from resource doesn't seem to be loaded! :("); + } + } + + private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) + { + /* + if (TheImage.ActualWidth <= 0) + { + throw new Exception("Image doesn't seem to be loaded! :("); + } + */ + } + } +} diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.Designer.cs b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.Designer.cs new file mode 100644 index 00000000..0281d64f --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ClassLibraryCore.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassLibraryCore.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap image { + get { + object obj = ResourceManager.GetObject("image", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.resx b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.resx new file mode 100644 index 00000000..99f83cee --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Resources/image.png b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Resources/image.png new file mode 100644 index 00000000..7eb2b9ad Binary files /dev/null and b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/Resources/image.png differ diff --git a/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/TextBlockStyles.xaml b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/TextBlockStyles.xaml new file mode 100644 index 00000000..5c0a3270 --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/ClassLibraryCore/TextBlockStyles.xaml @@ -0,0 +1,8 @@ + + + + diff --git a/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/.vs/WPFSampleApplicationCore/DesignTimeBuild/.dtbcache.v2 b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/.vs/WPFSampleApplicationCore/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 00000000..1708aa10 Binary files /dev/null and b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/.vs/WPFSampleApplicationCore/DesignTimeBuild/.dtbcache.v2 differ diff --git a/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/AssemblyInfo.cs b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/AssemblyInfo.cs new file mode 100644 index 00000000..8b5504ec --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/MainWindow.xaml b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/MainWindow.xaml new file mode 100644 index 00000000..87ccb4ec --- /dev/null +++ b/ILRepack.IntegrationTests/Scenarios/WPFSampleApplicationCore/MainWindow.xaml @@ -0,0 +1,17 @@ + + +