System.Data.Services.Client uses System.Resources for localization
purposes (even though only one language is provided...). Consequently,
to get _useful_ strings (read: error messages) out of
System.Data.Services.Client, System.Resources needs to be able to find
them, such that the following works:
$ csharp -r:System.Data.Services.Client;
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.Resources;
csharp> using System.Data.Services.Client;
csharp> var a = typeof(SendingRequestEventArgs).Assembly;
csharp> var r = new ResourceManager("System.Data.Services.Client", a);
csharp> r.GetString("AtomMaterializer_PropertyNotExpectedEntry");
If `r.GetString()` fails, it'll throw an exception instead of
returning a useful string, which is bad. Unfortunately, it failed.
To fix this, we use `resgen` to compile
Client/System.Data.Services.Client.txt into a .resources file and
compile the .resources file into the assembly with `gmcs -resource:`,
which allows the above `csharp` fragment to work w/o throwing (and
thus allows OData users to get useful, meaningful error messages).
LIBRARY = System.Data.Services.Client.dll
+Client/System.Data.Services.Client.resources: Client/System.Data.Services.Client.txt
+ $(RESGEN) "$<" "$@"
+
LIB_MCS_FLAGS = \
-d:NET_3_5 \
-r:System.dll \
-r:System.Xml.Linq.dll \
-r:System.Data.dll \
-r:System.Xml.dll \
+ -resource:Client/System.Data.Services.Client.resources \
-warn:2
ifneq (2.1, $(FRAMEWORK_VERSION))
endif
include ../../build/library.make
+
+$(the_lib): Client/System.Data.Services.Client.resources
+
+EXTRA_DISTFILES = Client/System.Data.Services.Client.txt
+CLEAN_FILES += Client/System.Data.Services.Client.resources