Repository navigation
Description
Related: #1492
WPF uses
ResXFileCodeGeneratorit its builds. We have a resx with entries like this (Documents.resx)<data name="Invalid_35x35" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Invalid_35x35.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data>It generates getters that should look like this:
internal static System.Drawing.Bitmap Invalid_35x35 { get { object obj = ResourceManager.GetObject("Invalid_35x35", resourceCulture); return ((System.DrawingBitmap)(obj)); } }Suddenly, as of some recent VS build,
ResXFileCodeGeneratoris starting to emit files with getters that are instead like this (not the return type – they are plainobject)./// <summary> /// Looks up a localized resource of type System.Object similar to Microsoft.Build.Tasks.ResourceHandling.LiveObjectResource. /// </summary> internal static object Invalid_35x35 { get { object obj = ResourceManager.GetObject("Invalid_35x35", resourceCulture); return ((object)(obj)); } }Here is a standalone repro that illustrates the problem. Build with commandline msbuild (not
dotnet, usemsbuild, VS version dev16.3p2 29128.8.master, Int Preview).After building, open
obj\Debug\netcoreapp3.0\MS.Internal.Documents.Resources.csand you can see getters that returnobjectinstead of specifc types.
WPF uses
ResXFileCodeGeneratorit its builds. We have a resx with entries like this (Documents.resx)<data name="Invalid_35x35" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Invalid_35x35.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data>It generates getters that should look like this:
internal static System.Drawing.Bitmap Invalid_35x35 { get { object obj = ResourceManager.GetObject("Invalid_35x35", resourceCulture); return ((System.DrawingBitmap)(obj)); } }Suddenly, as of some recent VS build,
ResXFileCodeGeneratoris starting to emit files with getters that are instead like this (not the return type – they are plainobject)./// <summary> /// Looks up a localized resource of type System.Object similar to Microsoft.Build.Tasks.ResourceHandling.LiveObjectResource. /// </summary> internal static object Invalid_35x35 { get { object obj = ResourceManager.GetObject("Invalid_35x35", resourceCulture); return ((object)(obj)); } }Here is a standalone repro that illustrates the problem. Build with commandline msbuild (not
dotnet, usemsbuild, VS version dev16.3p2 29128.8.master, Int Preview).After building, open
obj\Debug\netcoreapp3.0\MS.Internal.Documents.Resources.csand you can see getters that returnobjectinstead of specifc types.
Activity
vatsan-madhavan commentedon Aug 1, 2019
Internal PR at https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int/pullrequest/2455?_a=overview
vatsan-madhavan commentedon Aug 1, 2019
For now,
vatsan-madhavan commentedon Aug 1, 2019
This has been committed.
480d72dd985ccb25e9243449f015461136263de7