Просмотр исходного кода

Added NOEXTENSIONS and NOFILEVERSION. Internalized golden_message test dependencies

csharptest 13 лет назад
Родитель
Сommit
0f56b84298

+ 12 - 12
src/ProtocolBuffers.Serialization/Extensions.cs

@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers
         /// around Serialization.JsonFormatWriter.WriteMessage.
         /// </summary>
         public static string ToJson(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             IMessageLite message)
@@ -32,7 +32,7 @@ namespace Google.ProtocolBuffers
         /// around Serialization.XmlFormatWriter.WriteMessage.
         /// </summary>
         public static string ToXml(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             IMessageLite message)
@@ -46,7 +46,7 @@ namespace Google.ProtocolBuffers
         /// This is a trivial wrapper around Serialization.XmlFormatWriter.WriteMessage.
         /// </summary>
         public static string ToXml(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             IMessageLite message, string rootElementName)
@@ -64,7 +64,7 @@ namespace Google.ProtocolBuffers
         /// <param name="contentType">The mime type of the content to be written</param>
         /// <param name="output">The stream to write the message to</param>
         public static void WriteTo(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             IMessageLite message, MessageFormatOptions options, string contentType, Stream output)
@@ -88,7 +88,7 @@ namespace Google.ProtocolBuffers
         /// Merges a JSON object into this builder and returns
         /// </summary>
         public static TBuilder MergeFromJson<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, string jsonText) where TBuilder : IBuilderLite
@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers
         /// Merges a JSON object into this builder and returns
         /// </summary>
         public static TBuilder MergeFromJson<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, TextReader reader) where TBuilder : IBuilderLite
@@ -111,7 +111,7 @@ namespace Google.ProtocolBuffers
         /// Merges a JSON object into this builder using the extensions provided and returns
         /// </summary>
         public static TBuilder MergeFromJson<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, TextReader reader, ExtensionRegistry extensionRegistry) where TBuilder : IBuilderLite
@@ -124,7 +124,7 @@ namespace Google.ProtocolBuffers
         /// Merges an XML object into this builder and returns
         /// </summary>
         public static TBuilder MergeFromXml<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, XmlReader reader) where TBuilder : IBuilderLite
@@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers
         /// Merges an XML object into this builder and returns
         /// </summary>
         public static TBuilder MergeFromXml<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, string rootElementName, XmlReader reader) where TBuilder : IBuilderLite
@@ -148,7 +148,7 @@ namespace Google.ProtocolBuffers
         /// Merges an XML object into this builder using the extensions provided and returns
         /// </summary>
         public static TBuilder MergeFromXml<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, string rootElementName, XmlReader reader,
@@ -168,7 +168,7 @@ namespace Google.ProtocolBuffers
         /// <param name="input">The stream to read the message from</param>
         /// <returns>The same builder instance that was supplied in the builder parameter</returns>
         public static TBuilder MergeFrom<TBuilder>(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             TBuilder builder, MessageFormatOptions options, string contentType, Stream input) where TBuilder : IBuilderLite
@@ -195,7 +195,7 @@ namespace Google.ProtocolBuffers
         /// <param name="responseType">The mime type for the output stream</param>
         /// <param name="output">The output stream</param>
         public static void HttpCallMethod(
-#if !NET20
+#if !NOEXTENSIONS
             this
 #endif
             IRpcServerStub stub, string methodName, MessageFormatOptions options,

+ 1 - 1
src/ProtocolBuffers.Serialization/Properties/AssemblyInfo.cs

@@ -68,8 +68,8 @@ using System.Runtime.CompilerServices;
 // [assembly: AssemblyVersion("2.4.1.473")]
 
 [assembly: AssemblyVersion("2.4.1.473")]
-#if !COMPACT_FRAMEWORK
 
+#if !NOFILEVERSION
 [assembly: AssemblyFileVersion("2.4.1.473")]
 #endif
 

+ 4 - 5
src/ProtocolBuffers.Serialization/ProtocolBuffers.Serialization.csproj

@@ -25,10 +25,11 @@
     <OutputPath>bin\Debug\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -36,13 +37,11 @@
     <OutputPath>bin\Release\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
-    <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />

+ 4 - 5
src/ProtocolBuffers.Serialization/ProtocolBuffersLite.Serialization.csproj

@@ -25,10 +25,11 @@
     <OutputPath>bin\Debug\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>DEBUG;TRACE;LITE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -36,13 +37,11 @@
     <OutputPath>bin\Release\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>TRACE;LITE</DefineConstants>
+    <DefineConstants>TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(TargetFrameworkVersion)' == 'v2.0' ">
-    <DefineConstants>NET20;$(DefineConstants)</DefineConstants>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />

+ 2 - 2
src/ProtocolBuffers.Test/Properties/AssemblyInfo.cs

@@ -38,9 +38,9 @@ using System.Runtime.InteropServices;
 // [assembly: AssemblyVersion("2.4.1.473")]
 
 [assembly: AssemblyVersion("2.4.1.473")]
-#if !COMPACT_FRAMEWORK
-[assembly: AssemblyFileVersion("2.4.1.473")]
 
+#if !NOFILEVERSION
+[assembly: AssemblyFileVersion("2.4.1.473")]
 #endif
 
 // We don't really need CLSCompliance, but if the assembly builds with no warnings,

+ 5 - 21
src/ProtocolBuffers.Test/ProtocolBuffers.Test.csproj

@@ -23,21 +23,23 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />
@@ -78,11 +80,7 @@
     <Compile Include="Compatibility\XmlCompatibilityTests.cs" />
     <Compile Include="SerializableAttribute.cs" />
     <Compile Include="TestProtos\UnitTestExtrasProtoFile.cs" />
-    <Compile Include="TestResources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>TestResources.resx</DependentUpon>
-    </Compile>
+    <Compile Include="TestResources.cs" />
     <Compile Include="TestRpcForMimeTypes.cs" />
     <Compile Include="TestReaderForUrlEncoded.cs" />
     <Compile Include="CSharpOptionsTest.cs" />
@@ -160,20 +158,6 @@
   <ItemGroup>
     <EmbeddedResource Include="Compatibility\google_message1.dat" />
     <EmbeddedResource Include="Compatibility\google_message2.dat" />
-    <EmbeddedResource Include="TestResources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>TestResources.Designer.cs</LastGenOutput>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Resources\golden_message" />
-    <None Include="Resources\golden_packed_fields_message" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Resources\text_format_unittest_data.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Resources\text_format_unittest_extensions_data.txt" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 

BIN
src/ProtocolBuffers.Test/Resources/golden_message


BIN
src/ProtocolBuffers.Test/Resources/golden_packed_fields_message


+ 0 - 116
src/ProtocolBuffers.Test/Resources/text_format_unittest_data.txt

@@ -1,116 +0,0 @@
-optional_int32: 101
-optional_int64: 102
-optional_uint32: 103
-optional_uint64: 104
-optional_sint32: 105
-optional_sint64: 106
-optional_fixed32: 107
-optional_fixed64: 108
-optional_sfixed32: 109
-optional_sfixed64: 110
-optional_float: 111
-optional_double: 112
-optional_bool: true
-optional_string: "115"
-optional_bytes: "116"
-OptionalGroup {
-  a: 117
-}
-optional_nested_message {
-  bb: 118
-}
-optional_foreign_message {
-  c: 119
-}
-optional_import_message {
-  d: 120
-}
-optional_nested_enum: BAZ
-optional_foreign_enum: FOREIGN_BAZ
-optional_import_enum: IMPORT_BAZ
-optional_string_piece: "124"
-optional_cord: "125"
-repeated_int32: 201
-repeated_int32: 301
-repeated_int64: 202
-repeated_int64: 302
-repeated_uint32: 203
-repeated_uint32: 303
-repeated_uint64: 204
-repeated_uint64: 304
-repeated_sint32: 205
-repeated_sint32: 305
-repeated_sint64: 206
-repeated_sint64: 306
-repeated_fixed32: 207
-repeated_fixed32: 307
-repeated_fixed64: 208
-repeated_fixed64: 308
-repeated_sfixed32: 209
-repeated_sfixed32: 309
-repeated_sfixed64: 210
-repeated_sfixed64: 310
-repeated_float: 211
-repeated_float: 311
-repeated_double: 212
-repeated_double: 312
-repeated_bool: true
-repeated_bool: false
-repeated_string: "215"
-repeated_string: "315"
-repeated_bytes: "216"
-repeated_bytes: "316"
-RepeatedGroup {
-  a: 217
-}
-RepeatedGroup {
-  a: 317
-}
-repeated_nested_message {
-  bb: 218
-}
-repeated_nested_message {
-  bb: 318
-}
-repeated_foreign_message {
-  c: 219
-}
-repeated_foreign_message {
-  c: 319
-}
-repeated_import_message {
-  d: 220
-}
-repeated_import_message {
-  d: 320
-}
-repeated_nested_enum: BAR
-repeated_nested_enum: BAZ
-repeated_foreign_enum: FOREIGN_BAR
-repeated_foreign_enum: FOREIGN_BAZ
-repeated_import_enum: IMPORT_BAR
-repeated_import_enum: IMPORT_BAZ
-repeated_string_piece: "224"
-repeated_string_piece: "324"
-repeated_cord: "225"
-repeated_cord: "325"
-default_int32: 401
-default_int64: 402
-default_uint32: 403
-default_uint64: 404
-default_sint32: 405
-default_sint64: 406
-default_fixed32: 407
-default_fixed64: 408
-default_sfixed32: 409
-default_sfixed64: 410
-default_float: 411
-default_double: 412
-default_bool: false
-default_string: "415"
-default_bytes: "416"
-default_nested_enum: FOO
-default_foreign_enum: FOREIGN_FOO
-default_import_enum: IMPORT_FOO
-default_string_piece: "424"
-default_cord: "425"

+ 0 - 116
src/ProtocolBuffers.Test/Resources/text_format_unittest_extensions_data.txt

@@ -1,116 +0,0 @@
-[protobuf_unittest.optional_int32_extension]: 101
-[protobuf_unittest.optional_int64_extension]: 102
-[protobuf_unittest.optional_uint32_extension]: 103
-[protobuf_unittest.optional_uint64_extension]: 104
-[protobuf_unittest.optional_sint32_extension]: 105
-[protobuf_unittest.optional_sint64_extension]: 106
-[protobuf_unittest.optional_fixed32_extension]: 107
-[protobuf_unittest.optional_fixed64_extension]: 108
-[protobuf_unittest.optional_sfixed32_extension]: 109
-[protobuf_unittest.optional_sfixed64_extension]: 110
-[protobuf_unittest.optional_float_extension]: 111
-[protobuf_unittest.optional_double_extension]: 112
-[protobuf_unittest.optional_bool_extension]: true
-[protobuf_unittest.optional_string_extension]: "115"
-[protobuf_unittest.optional_bytes_extension]: "116"
-[protobuf_unittest.optionalgroup_extension] {
-  a: 117
-}
-[protobuf_unittest.optional_nested_message_extension] {
-  bb: 118
-}
-[protobuf_unittest.optional_foreign_message_extension] {
-  c: 119
-}
-[protobuf_unittest.optional_import_message_extension] {
-  d: 120
-}
-[protobuf_unittest.optional_nested_enum_extension]: BAZ
-[protobuf_unittest.optional_foreign_enum_extension]: FOREIGN_BAZ
-[protobuf_unittest.optional_import_enum_extension]: IMPORT_BAZ
-[protobuf_unittest.optional_string_piece_extension]: "124"
-[protobuf_unittest.optional_cord_extension]: "125"
-[protobuf_unittest.repeated_int32_extension]: 201
-[protobuf_unittest.repeated_int32_extension]: 301
-[protobuf_unittest.repeated_int64_extension]: 202
-[protobuf_unittest.repeated_int64_extension]: 302
-[protobuf_unittest.repeated_uint32_extension]: 203
-[protobuf_unittest.repeated_uint32_extension]: 303
-[protobuf_unittest.repeated_uint64_extension]: 204
-[protobuf_unittest.repeated_uint64_extension]: 304
-[protobuf_unittest.repeated_sint32_extension]: 205
-[protobuf_unittest.repeated_sint32_extension]: 305
-[protobuf_unittest.repeated_sint64_extension]: 206
-[protobuf_unittest.repeated_sint64_extension]: 306
-[protobuf_unittest.repeated_fixed32_extension]: 207
-[protobuf_unittest.repeated_fixed32_extension]: 307
-[protobuf_unittest.repeated_fixed64_extension]: 208
-[protobuf_unittest.repeated_fixed64_extension]: 308
-[protobuf_unittest.repeated_sfixed32_extension]: 209
-[protobuf_unittest.repeated_sfixed32_extension]: 309
-[protobuf_unittest.repeated_sfixed64_extension]: 210
-[protobuf_unittest.repeated_sfixed64_extension]: 310
-[protobuf_unittest.repeated_float_extension]: 211
-[protobuf_unittest.repeated_float_extension]: 311
-[protobuf_unittest.repeated_double_extension]: 212
-[protobuf_unittest.repeated_double_extension]: 312
-[protobuf_unittest.repeated_bool_extension]: true
-[protobuf_unittest.repeated_bool_extension]: false
-[protobuf_unittest.repeated_string_extension]: "215"
-[protobuf_unittest.repeated_string_extension]: "315"
-[protobuf_unittest.repeated_bytes_extension]: "216"
-[protobuf_unittest.repeated_bytes_extension]: "316"
-[protobuf_unittest.repeatedgroup_extension] {
-  a: 217
-}
-[protobuf_unittest.repeatedgroup_extension] {
-  a: 317
-}
-[protobuf_unittest.repeated_nested_message_extension] {
-  bb: 218
-}
-[protobuf_unittest.repeated_nested_message_extension] {
-  bb: 318
-}
-[protobuf_unittest.repeated_foreign_message_extension] {
-  c: 219
-}
-[protobuf_unittest.repeated_foreign_message_extension] {
-  c: 319
-}
-[protobuf_unittest.repeated_import_message_extension] {
-  d: 220
-}
-[protobuf_unittest.repeated_import_message_extension] {
-  d: 320
-}
-[protobuf_unittest.repeated_nested_enum_extension]: BAR
-[protobuf_unittest.repeated_nested_enum_extension]: BAZ
-[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAR
-[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAZ
-[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAR
-[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAZ
-[protobuf_unittest.repeated_string_piece_extension]: "224"
-[protobuf_unittest.repeated_string_piece_extension]: "324"
-[protobuf_unittest.repeated_cord_extension]: "225"
-[protobuf_unittest.repeated_cord_extension]: "325"
-[protobuf_unittest.default_int32_extension]: 401
-[protobuf_unittest.default_int64_extension]: 402
-[protobuf_unittest.default_uint32_extension]: 403
-[protobuf_unittest.default_uint64_extension]: 404
-[protobuf_unittest.default_sint32_extension]: 405
-[protobuf_unittest.default_sint64_extension]: 406
-[protobuf_unittest.default_fixed32_extension]: 407
-[protobuf_unittest.default_fixed64_extension]: 408
-[protobuf_unittest.default_sfixed32_extension]: 409
-[protobuf_unittest.default_sfixed64_extension]: 410
-[protobuf_unittest.default_float_extension]: 411
-[protobuf_unittest.default_double_extension]: 412
-[protobuf_unittest.default_bool_extension]: false
-[protobuf_unittest.default_string_extension]: "415"
-[protobuf_unittest.default_bytes_extension]: "416"
-[protobuf_unittest.default_nested_enum_extension]: FOO
-[protobuf_unittest.default_foreign_enum_extension]: FOREIGN_FOO
-[protobuf_unittest.default_import_enum_extension]: IMPORT_FOO
-[protobuf_unittest.default_string_piece_extension]: "424"
-[protobuf_unittest.default_cord_extension]: "425"

+ 0 - 131
src/ProtocolBuffers.Test/TestResources.Designer.cs

@@ -1,131 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:2.0.50727.5456
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace Google.ProtocolBuffers {
-    using System;
-    
-    
-    /// <summary>
-    ///   A strongly-typed resource class, for looking up localized strings, etc.
-    /// </summary>
-    // 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", "2.0.0.0")]
-    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class TestResources {
-        
-        private static global::System.Resources.ResourceManager resourceMan;
-        
-        private static global::System.Globalization.CultureInfo resourceCulture;
-        
-        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal TestResources() {
-        }
-        
-        /// <summary>
-        ///   Returns the cached ResourceManager instance used by this class.
-        /// </summary>
-        [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("Google.ProtocolBuffers.TestResources", typeof(TestResources).Assembly);
-                    resourceMan = temp;
-                }
-                return resourceMan;
-            }
-        }
-        
-        /// <summary>
-        ///   Overrides the current thread's CurrentUICulture property for all
-        ///   resource lookups using this strongly typed resource class.
-        /// </summary>
-        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture {
-            get {
-                return resourceCulture;
-            }
-            set {
-                resourceCulture = value;
-            }
-        }
-        
-        internal static byte[] golden_message {
-            get {
-                object obj = ResourceManager.GetObject("golden_message", resourceCulture);
-                return ((byte[])(obj));
-            }
-        }
-        
-        internal static byte[] golden_packed_fields_message {
-            get {
-                object obj = ResourceManager.GetObject("golden_packed_fields_message", resourceCulture);
-                return ((byte[])(obj));
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to optional_int32: 101
-        ///optional_int64: 102
-        ///optional_uint32: 103
-        ///optional_uint64: 104
-        ///optional_sint32: 105
-        ///optional_sint64: 106
-        ///optional_fixed32: 107
-        ///optional_fixed64: 108
-        ///optional_sfixed32: 109
-        ///optional_sfixed64: 110
-        ///optional_float: 111
-        ///optional_double: 112
-        ///optional_bool: true
-        ///optional_string: &quot;115&quot;
-        ///optional_bytes: &quot;116&quot;
-        ///OptionalGroup {
-        ///  a: 117
-        ///}
-        ///optional_nested_message {
-        ///  bb: 118
-        ///}
-        ///optional_foreign_message {
-        ///  c: 119
-        ///}
-        ///optional_import_message {
-        ///  d: 120
-        ///}
-        ///optional_nested_enum: BAZ [rest of string was truncated]&quot;;.
-        /// </summary>
-        internal static string text_format_unittest_data {
-            get {
-                return ResourceManager.GetString("text_format_unittest_data", resourceCulture);
-            }
-        }
-        
-        /// <summary>
-        ///   Looks up a localized string similar to [protobuf_unittest.optional_int32_extension]: 101
-        ///[protobuf_unittest.optional_int64_extension]: 102
-        ///[protobuf_unittest.optional_uint32_extension]: 103
-        ///[protobuf_unittest.optional_uint64_extension]: 104
-        ///[protobuf_unittest.optional_sint32_extension]: 105
-        ///[protobuf_unittest.optional_sint64_extension]: 106
-        ///[protobuf_unittest.optional_fixed32_extension]: 107
-        ///[protobuf_unittest.optional_fixed64_extension]: 108
-        ///[protobuf_unittest.optional_sfixed32_extension]: 109
-        ///[protobuf_unittest.optional_sfixed64_exten [rest of string was truncated]&quot;;.
-        /// </summary>
-        internal static string text_format_unittest_extensions_data {
-            get {
-                return ResourceManager.GetString("text_format_unittest_extensions_data", resourceCulture);
-            }
-        }
-    }
-}

+ 294 - 0
src/ProtocolBuffers.Test/TestResources.cs

@@ -0,0 +1,294 @@
+namespace Google.ProtocolBuffers
+{
+    internal class TestResources
+    {
+        #region golden_message
+        internal static byte[] golden_message
+        {
+            get
+            {
+                return System.Convert.FromBase64String(@"
+CGUQZhhnIGgo0gEw1AE9awAAAEFsAAAAAAAAAE1tAAAAUW4AAAAAAAAAXQAA3kJhAAAAAAAAXEBo
+AXIDMTE1egMxMTaDAYgBdYQBkgECCHaaAQIId6IBAgh4qAEDsAEGuAEJwgEDMTI0ygEDMTI1+AHJ
+AfgBrQKAAsoBgAKuAogCywGIAq8CkALMAZACsAKYApoDmALiBKACnAOgAuQErQLPAAAArQIzAQAA
+sQLQAAAAAAAAALECNAEAAAAAAAC9AtEAAAC9AjUBAADBAtIAAAAAAAAAwQI2AQAAAAAAAM0CAABT
+Q80CAICbQ9ECAAAAAACAakDRAgAAAAAAgHNA2AIB2AIA4gIDMjE14gIDMzE16gIDMjE26gIDMzE2
+8wL4AtkB9ALzAvgCvQL0AoIDAwjaAYIDAwi+AooDAwjbAYoDAwi/ApIDAwjcAZIDAwjAApgDApgD
+A6ADBaADBqgDCKgDCbIDAzIyNLIDAzMyNLoDAzIyNboDAzMyNegDkQPwA5ID+AOTA4AElAOIBKoG
+kASsBp0ElwEAAKEEmAEAAAAAAACtBJkBAACxBJoBAAAAAAAAvQQAgM1DwQQAAAAAAMB5QMgEANIE
+AzQxNdoEAzQxNogFAZAFBJgFB6IFAzQyNKoFAzQyNQ==
+");
+            }
+        }
+        #endregion
+
+        #region golden_packed_fields_message
+        internal static byte[] golden_packed_fields_message
+        {
+            get
+            {
+                return System.Convert.FromBase64String(@"
+0gUE2QS9BdoFBNoEvgXiBQTbBL8F6gUE3ATABfIFBLoJggv6BQS8CYQLggYIXwIAAMMCAACKBhBg
+AgAAAAAAAMQCAAAAAAAAkgYIYQIAAMUCAACaBhBiAgAAAAAAAMYCAAAAAAAAogYIAMAYRADAMUSq
+BhAAAAAAACCDQAAAAAAAQIZAsgYCAQC6BgIFBg==
+");
+            }
+        }
+        #endregion
+
+        #region text_format_unittest_data
+        internal static string text_format_unittest_data
+        {
+            get
+            {
+                return @"
+optional_int32: 101
+optional_int64: 102
+optional_uint32: 103
+optional_uint64: 104
+optional_sint32: 105
+optional_sint64: 106
+optional_fixed32: 107
+optional_fixed64: 108
+optional_sfixed32: 109
+optional_sfixed64: 110
+optional_float: 111
+optional_double: 112
+optional_bool: true
+optional_string: ""115""
+optional_bytes: ""116""
+OptionalGroup {
+  a: 117
+}
+optional_nested_message {
+  bb: 118
+}
+optional_foreign_message {
+  c: 119
+}
+optional_import_message {
+  d: 120
+}
+optional_nested_enum: BAZ
+optional_foreign_enum: FOREIGN_BAZ
+optional_import_enum: IMPORT_BAZ
+optional_string_piece: ""124""
+optional_cord: ""125""
+repeated_int32: 201
+repeated_int32: 301
+repeated_int64: 202
+repeated_int64: 302
+repeated_uint32: 203
+repeated_uint32: 303
+repeated_uint64: 204
+repeated_uint64: 304
+repeated_sint32: 205
+repeated_sint32: 305
+repeated_sint64: 206
+repeated_sint64: 306
+repeated_fixed32: 207
+repeated_fixed32: 307
+repeated_fixed64: 208
+repeated_fixed64: 308
+repeated_sfixed32: 209
+repeated_sfixed32: 309
+repeated_sfixed64: 210
+repeated_sfixed64: 310
+repeated_float: 211
+repeated_float: 311
+repeated_double: 212
+repeated_double: 312
+repeated_bool: true
+repeated_bool: false
+repeated_string: ""215""
+repeated_string: ""315""
+repeated_bytes: ""216""
+repeated_bytes: ""316""
+RepeatedGroup {
+  a: 217
+}
+RepeatedGroup {
+  a: 317
+}
+repeated_nested_message {
+  bb: 218
+}
+repeated_nested_message {
+  bb: 318
+}
+repeated_foreign_message {
+  c: 219
+}
+repeated_foreign_message {
+  c: 319
+}
+repeated_import_message {
+  d: 220
+}
+repeated_import_message {
+  d: 320
+}
+repeated_nested_enum: BAR
+repeated_nested_enum: BAZ
+repeated_foreign_enum: FOREIGN_BAR
+repeated_foreign_enum: FOREIGN_BAZ
+repeated_import_enum: IMPORT_BAR
+repeated_import_enum: IMPORT_BAZ
+repeated_string_piece: ""224""
+repeated_string_piece: ""324""
+repeated_cord: ""225""
+repeated_cord: ""325""
+default_int32: 401
+default_int64: 402
+default_uint32: 403
+default_uint64: 404
+default_sint32: 405
+default_sint64: 406
+default_fixed32: 407
+default_fixed64: 408
+default_sfixed32: 409
+default_sfixed64: 410
+default_float: 411
+default_double: 412
+default_bool: false
+default_string: ""415""
+default_bytes: ""416""
+default_nested_enum: FOO
+default_foreign_enum: FOREIGN_FOO
+default_import_enum: IMPORT_FOO
+default_string_piece: ""424""
+default_cord: ""425""
+
+";
+            }
+        }
+        #endregion
+
+        #region text_format_unittest_extensions_data
+        internal static string text_format_unittest_extensions_data
+        {
+            get
+            {
+                return @"
+[protobuf_unittest.optional_int32_extension]: 101
+[protobuf_unittest.optional_int64_extension]: 102
+[protobuf_unittest.optional_uint32_extension]: 103
+[protobuf_unittest.optional_uint64_extension]: 104
+[protobuf_unittest.optional_sint32_extension]: 105
+[protobuf_unittest.optional_sint64_extension]: 106
+[protobuf_unittest.optional_fixed32_extension]: 107
+[protobuf_unittest.optional_fixed64_extension]: 108
+[protobuf_unittest.optional_sfixed32_extension]: 109
+[protobuf_unittest.optional_sfixed64_extension]: 110
+[protobuf_unittest.optional_float_extension]: 111
+[protobuf_unittest.optional_double_extension]: 112
+[protobuf_unittest.optional_bool_extension]: true
+[protobuf_unittest.optional_string_extension]: ""115""
+[protobuf_unittest.optional_bytes_extension]: ""116""
+[protobuf_unittest.optionalgroup_extension] {
+  a: 117
+}
+[protobuf_unittest.optional_nested_message_extension] {
+  bb: 118
+}
+[protobuf_unittest.optional_foreign_message_extension] {
+  c: 119
+}
+[protobuf_unittest.optional_import_message_extension] {
+  d: 120
+}
+[protobuf_unittest.optional_nested_enum_extension]: BAZ
+[protobuf_unittest.optional_foreign_enum_extension]: FOREIGN_BAZ
+[protobuf_unittest.optional_import_enum_extension]: IMPORT_BAZ
+[protobuf_unittest.optional_string_piece_extension]: ""124""
+[protobuf_unittest.optional_cord_extension]: ""125""
+[protobuf_unittest.repeated_int32_extension]: 201
+[protobuf_unittest.repeated_int32_extension]: 301
+[protobuf_unittest.repeated_int64_extension]: 202
+[protobuf_unittest.repeated_int64_extension]: 302
+[protobuf_unittest.repeated_uint32_extension]: 203
+[protobuf_unittest.repeated_uint32_extension]: 303
+[protobuf_unittest.repeated_uint64_extension]: 204
+[protobuf_unittest.repeated_uint64_extension]: 304
+[protobuf_unittest.repeated_sint32_extension]: 205
+[protobuf_unittest.repeated_sint32_extension]: 305
+[protobuf_unittest.repeated_sint64_extension]: 206
+[protobuf_unittest.repeated_sint64_extension]: 306
+[protobuf_unittest.repeated_fixed32_extension]: 207
+[protobuf_unittest.repeated_fixed32_extension]: 307
+[protobuf_unittest.repeated_fixed64_extension]: 208
+[protobuf_unittest.repeated_fixed64_extension]: 308
+[protobuf_unittest.repeated_sfixed32_extension]: 209
+[protobuf_unittest.repeated_sfixed32_extension]: 309
+[protobuf_unittest.repeated_sfixed64_extension]: 210
+[protobuf_unittest.repeated_sfixed64_extension]: 310
+[protobuf_unittest.repeated_float_extension]: 211
+[protobuf_unittest.repeated_float_extension]: 311
+[protobuf_unittest.repeated_double_extension]: 212
+[protobuf_unittest.repeated_double_extension]: 312
+[protobuf_unittest.repeated_bool_extension]: true
+[protobuf_unittest.repeated_bool_extension]: false
+[protobuf_unittest.repeated_string_extension]: ""215""
+[protobuf_unittest.repeated_string_extension]: ""315""
+[protobuf_unittest.repeated_bytes_extension]: ""216""
+[protobuf_unittest.repeated_bytes_extension]: ""316""
+[protobuf_unittest.repeatedgroup_extension] {
+  a: 217
+}
+[protobuf_unittest.repeatedgroup_extension] {
+  a: 317
+}
+[protobuf_unittest.repeated_nested_message_extension] {
+  bb: 218
+}
+[protobuf_unittest.repeated_nested_message_extension] {
+  bb: 318
+}
+[protobuf_unittest.repeated_foreign_message_extension] {
+  c: 219
+}
+[protobuf_unittest.repeated_foreign_message_extension] {
+  c: 319
+}
+[protobuf_unittest.repeated_import_message_extension] {
+  d: 220
+}
+[protobuf_unittest.repeated_import_message_extension] {
+  d: 320
+}
+[protobuf_unittest.repeated_nested_enum_extension]: BAR
+[protobuf_unittest.repeated_nested_enum_extension]: BAZ
+[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAR
+[protobuf_unittest.repeated_foreign_enum_extension]: FOREIGN_BAZ
+[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAR
+[protobuf_unittest.repeated_import_enum_extension]: IMPORT_BAZ
+[protobuf_unittest.repeated_string_piece_extension]: ""224""
+[protobuf_unittest.repeated_string_piece_extension]: ""324""
+[protobuf_unittest.repeated_cord_extension]: ""225""
+[protobuf_unittest.repeated_cord_extension]: ""325""
+[protobuf_unittest.default_int32_extension]: 401
+[protobuf_unittest.default_int64_extension]: 402
+[protobuf_unittest.default_uint32_extension]: 403
+[protobuf_unittest.default_uint64_extension]: 404
+[protobuf_unittest.default_sint32_extension]: 405
+[protobuf_unittest.default_sint64_extension]: 406
+[protobuf_unittest.default_fixed32_extension]: 407
+[protobuf_unittest.default_fixed64_extension]: 408
+[protobuf_unittest.default_sfixed32_extension]: 409
+[protobuf_unittest.default_sfixed64_extension]: 410
+[protobuf_unittest.default_float_extension]: 411
+[protobuf_unittest.default_double_extension]: 412
+[protobuf_unittest.default_bool_extension]: false
+[protobuf_unittest.default_string_extension]: ""415""
+[protobuf_unittest.default_bytes_extension]: ""416""
+[protobuf_unittest.default_nested_enum_extension]: FOO
+[protobuf_unittest.default_foreign_enum_extension]: FOREIGN_FOO
+[protobuf_unittest.default_import_enum_extension]: IMPORT_FOO
+[protobuf_unittest.default_string_piece_extension]: ""424""
+[protobuf_unittest.default_cord_extension]: ""425""
+";
+            }
+        }
+        #endregion
+    }
+}

+ 0 - 133
src/ProtocolBuffers.Test/TestResources.resx

@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="golden_message" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>Resources\golden_message;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name="golden_packed_fields_message" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>Resources\golden_packed_fields_message;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name="text_format_unittest_data" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>Resources\text_format_unittest_data.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
-  </data>
-  <data name="text_format_unittest_extensions_data" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>Resources\text_format_unittest_extensions_data.txt;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
-  </data>
-</root>

+ 3 - 3
src/ProtocolBuffers.Test/TextFormatTest.cs

@@ -94,8 +94,8 @@ namespace Google.ProtocolBuffers
             TestUtil.TestInMultipleCultures(() =>
                                                 {
                                                     string text = TextFormat.PrintToString(TestUtil.GetAllSet());
-                                                    Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n"),
-                                                                    text.Replace("\r\n", "\n"));
+                                                    Assert.AreEqual(AllFieldsSetText.Replace("\r\n", "\n").Trim(),
+                                                                    text.Replace("\r\n", "\n").Trim());
                                                 });
         }
 
@@ -107,7 +107,7 @@ namespace Google.ProtocolBuffers
         {
             string text = TextFormat.PrintToString(TestUtil.GetAllExtensionsSet());
 
-            Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n"), text.Replace("\r\n", "\n"));
+            Assert.AreEqual(AllExtensionsSetText.Replace("\r\n", "\n").Trim(), text.Replace("\r\n", "\n").Trim());
         }
 
         /// <summary>

+ 4 - 4
src/ProtocolBuffers/FieldAccess/ReflectionUtil.cs

@@ -137,7 +137,7 @@ namespace Google.ProtocolBuffers.FieldAccess
         internal static Func<TResult> CreateDelegateFunc<TResult>(MethodInfo method)
         {
 #if !NOCREATEDELEGATE
-            object tdelegate = Delegate.CreateDelegate(typeof(Func<TResult>), null, method, true);
+            object tdelegate = Delegate.CreateDelegate(typeof(Func<TResult>), null, method);
             return (Func<TResult>)tdelegate;
 #else
             return delegate() { return (TResult)method.Invoke(null, null); };
@@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers.FieldAccess
         internal static Func<T, TResult> CreateDelegateFunc<T, TResult>(MethodInfo method)
         {
 #if !NOCREATEDELEGATE
-            object tdelegate = Delegate.CreateDelegate(typeof(Func<T, TResult>), null, method, true);
+            object tdelegate = Delegate.CreateDelegate(typeof(Func<T, TResult>), null, method);
             return (Func<T, TResult>)tdelegate;
 #else
             if (method.IsStatic)
@@ -161,7 +161,7 @@ namespace Google.ProtocolBuffers.FieldAccess
         internal static Func<T1, T2, TResult> CreateDelegateFunc<T1, T2, TResult>(MethodInfo method)
         {
 #if !NOCREATEDELEGATE
-            object tdelegate = Delegate.CreateDelegate(typeof(Func<T1, T2, TResult>), null, method, true);
+            object tdelegate = Delegate.CreateDelegate(typeof(Func<T1, T2, TResult>), null, method);
             return (Func<T1, T2, TResult>)tdelegate;
 #else
             if (method.IsStatic)
@@ -175,7 +175,7 @@ namespace Google.ProtocolBuffers.FieldAccess
         internal static Action<T1, T2> CreateDelegateAction<T1, T2>(MethodInfo method)
         {
 #if !NOCREATEDELEGATE
-            object tdelegate = Delegate.CreateDelegate(typeof(Action<T1, T2>), null, method, true);
+            object tdelegate = Delegate.CreateDelegate(typeof(Action<T1, T2>), null, method);
             return (Action<T1, T2>)tdelegate;
 #else
             if (method.IsStatic)

+ 1 - 1
src/ProtocolBuffers/Properties/AssemblyInfo.cs

@@ -68,8 +68,8 @@ using System.Runtime.CompilerServices;
 // [assembly: AssemblyVersion("2.4.1.473")]
 
 [assembly: AssemblyVersion("2.4.1.473")]
-#if !COMPACT_FRAMEWORK
 
+#if !NOFILEVERSION
 [assembly: AssemblyFileVersion("2.4.1.473")]
 #endif
 

+ 4 - 2
src/ProtocolBuffers/ProtocolBuffers.csproj

@@ -25,11 +25,12 @@
     <OutputPath>bin\Debug\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -37,11 +38,12 @@
     <OutputPath>bin\Release\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />

+ 4 - 2
src/ProtocolBuffers/ProtocolBuffersLite.csproj

@@ -25,10 +25,11 @@
     <OutputPath>bin\Debug\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>DEBUG;TRACE;LITE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -36,10 +37,11 @@
     <OutputPath>bin\Release\</OutputPath>
     <DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
     <NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
-    <DefineConstants>TRACE;LITE</DefineConstants>
+    <DefineConstants>TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />

+ 55 - 0
src/ProtocolBuffersLibrary.sln

@@ -0,0 +1,55 @@
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers", "ProtocolBuffers\ProtocolBuffers.csproj", "{6908BDCE-D925-43F3-94AC-A531E6DF2591}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite", "ProtocolBuffers\ProtocolBuffersLite.csproj", "{6969BDCE-D925-43F3-94AC-A531E6DF2591}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffers.Serialization.csproj", "{231391AF-449C-4A39-986C-AD7F270F4750}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Serialization", "ProtocolBuffers.Serialization\ProtocolBuffersLite.Serialization.csproj", "{E067A59D-9D0A-4A1F-92B1-38E4457241D1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffers.Test", "ProtocolBuffers.Test\ProtocolBuffers.Test.csproj", "{DD01ED24-3750-4567-9A23-1DB676A15610}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLite.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLite.Test.csproj", "{EE01ED24-3750-4567-9A23-1DB676A15610}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProtocolBuffersLiteMixed.Test", "ProtocolBuffersLite.Test\ProtocolBuffersLiteMixed.Test.csproj", "{EEFFED24-3750-4567-9A23-1DB676A15610}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6908BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6969BDCE-D925-43F3-94AC-A531E6DF2591}.Release|Any CPU.Build.0 = Release|Any CPU
+		{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{231391AF-449C-4A39-986C-AD7F270F4750}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{231391AF-449C-4A39-986C-AD7F270F4750}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E067A59D-9D0A-4A1F-92B1-38E4457241D1}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DD01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DD01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
+		{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{EE01ED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{EE01ED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
+		{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{EEFFED24-3750-4567-9A23-1DB676A15610}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{EEFFED24-3750-4567-9A23-1DB676A15610}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 4 - 2
src/ProtocolBuffersLite.Test/ProtocolBuffersLite.Test.csproj

@@ -23,21 +23,23 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />

+ 4 - 2
src/ProtocolBuffersLite.Test/ProtocolBuffersLiteMixed.Test.csproj

@@ -23,21 +23,23 @@
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
+    <DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <NoStdLib>true</NoStdLib>
+    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="mscorlib" />