aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-04-29 15:27:14 +0100
committerJon Skeet <jonskeet@google.com>2015-04-29 21:15:16 +0100
commitce97e686826147e2a071fd2321555f7d40ec5d93 (patch)
tree873c55c5013021255b279ae45034c5276d798838 /csharp/src/ProtocolBuffers
parenta449f66bdb50f3e898889705945fb1ac6b105469 (diff)
downloadprotobuf-ce97e686826147e2a071fd2321555f7d40ec5d93.tar.gz
protobuf-ce97e686826147e2a071fd2321555f7d40ec5d93.tar.bz2
protobuf-ce97e686826147e2a071fd2321555f7d40ec5d93.zip
Convert both the full and lite runtimes (and json/xml serialization assemblies) to be Portable Class Libraries.
All referring projects are now .NET 4 client rather than .NET 3.5. This commit also fixes up the ProtoBench app, which I'd neglected in previous commits. (Disentangling the two sets of changes would be time-consuming.)
Diffstat (limited to 'csharp/src/ProtocolBuffers')
-rw-r--r--csharp/src/ProtocolBuffers/FieldSet.cs8
-rw-r--r--csharp/src/ProtocolBuffers/GeneratedMessage.cs4
-rw-r--r--csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs3
-rw-r--r--csharp/src/ProtocolBuffers/ProtocolBuffers.csproj17
-rw-r--r--csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj17
-rw-r--r--csharp/src/ProtocolBuffers/TextFormat.cs4
-rw-r--r--csharp/src/ProtocolBuffers/UnknownFieldSet.cs4
7 files changed, 26 insertions, 31 deletions
diff --git a/csharp/src/ProtocolBuffers/FieldSet.cs b/csharp/src/ProtocolBuffers/FieldSet.cs
index f3c08cf5..4177400f 100644
--- a/csharp/src/ProtocolBuffers/FieldSet.cs
+++ b/csharp/src/ProtocolBuffers/FieldSet.cs
@@ -88,7 +88,7 @@ namespace Google.ProtocolBuffers
public static FieldSet CreateInstance()
{
// Use SortedList to keep fields in the canonical order
- return new FieldSet(new SortedList<IFieldDescriptorLite, object>());
+ return new FieldSet(new SortedDictionary<IFieldDescriptorLite, object>());
}
/// <summary>
@@ -111,7 +111,7 @@ namespace Google.ProtocolBuffers
if (hasRepeats)
{
- var tmp = new SortedList<IFieldDescriptorLite, object>();
+ var tmp = new SortedDictionary<IFieldDescriptorLite, object>();
foreach (KeyValuePair<IFieldDescriptorLite, object> entry in fields)
{
IList<object> list = entry.Value as IList<object>;
@@ -151,8 +151,8 @@ namespace Google.ProtocolBuffers
{
get
{
- SortedList<FieldDescriptor, object> copy =
- new SortedList<FieldDescriptor, object>();
+ SortedDictionary<FieldDescriptor, object> copy =
+ new SortedDictionary<FieldDescriptor, object>();
foreach (KeyValuePair<IFieldDescriptorLite, object> fd in fields)
{
copy.Add((FieldDescriptor) fd.Key, fd.Value);
diff --git a/csharp/src/ProtocolBuffers/GeneratedMessage.cs b/csharp/src/ProtocolBuffers/GeneratedMessage.cs
index 6f4b6657..c17c15cf 100644
--- a/csharp/src/ProtocolBuffers/GeneratedMessage.cs
+++ b/csharp/src/ProtocolBuffers/GeneratedMessage.cs
@@ -75,8 +75,8 @@ namespace Google.ProtocolBuffers
internal IDictionary<FieldDescriptor, Object> GetMutableFieldMap()
{
- // Use a SortedList so we'll end up serializing fields in order
- var ret = new SortedList<FieldDescriptor, object>();
+ // Use a SortedDictionary so we'll end up serializing fields in order
+ var ret = new SortedDictionary<FieldDescriptor, object>();
MessageDescriptor descriptor = DescriptorForType;
foreach (FieldDescriptor field in descriptor.Fields)
{
diff --git a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs
index 063f6666..806bd5d5 100644
--- a/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs
+++ b/csharp/src/ProtocolBuffers/Properties/AssemblyInfo.cs
@@ -65,6 +65,3 @@ using System.Security;
[assembly: AssemblyFileVersion("2.4.1.555")]
#endif
-#if CLIENTPROFILE // ROK - not defined in SL, CF, or PL
-[assembly: AllowPartiallyTrustedCallers]
-#endif
diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj
index 5f6404a2..32a343ad 100644
--- a/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj
+++ b/csharp/src/ProtocolBuffers/ProtocolBuffers.csproj
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <EnvironmentFlavor>CLIENTPROFILE</EnvironmentFlavor>
- <EnvironmentTemplate>NET35</EnvironmentTemplate>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
@@ -12,18 +10,21 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Google.ProtocolBuffers</RootNamespace>
<AssemblyName>Google.ProtocolBuffers</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile92</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
<OldToolsVersion>3.5</OldToolsVersion>
+ <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\NET35\Debug</OutputPath>
- <IntermediateOutputPath>obj\NET35\Debug\</IntermediateOutputPath>
+ <OutputPath>bin\Debug</OutputPath>
+ <IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
<DefineConstants>DEBUG;TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
@@ -35,8 +36,8 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\NET35\Release</OutputPath>
- <IntermediateOutputPath>obj\NET35\Release\</IntermediateOutputPath>
+ <OutputPath>bin\Release</OutputPath>
+ <IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
<DefineConstants>TRACE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
@@ -137,7 +138,7 @@
<Compile Include="UnknownFieldSet.cs" />
<Compile Include="WireFormat.cs" />
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj
index fc6e163f..d0912a6b 100644
--- a/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj
+++ b/csharp/src/ProtocolBuffers/ProtocolBuffersLite.csproj
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
- <EnvironmentFlavor>CLIENTPROFILE</EnvironmentFlavor>
- <EnvironmentTemplate>NET35</EnvironmentTemplate>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
@@ -12,18 +10,21 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Google.ProtocolBuffers</RootNamespace>
<AssemblyName>Google.ProtocolBuffersLite</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile92</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
<OldToolsVersion>3.5</OldToolsVersion>
+ <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
- <OutputPath>bin\NET35\Debug</OutputPath>
- <IntermediateOutputPath>obj\NET35\Debug\</IntermediateOutputPath>
+ <OutputPath>bin\Debug</OutputPath>
+ <IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
<DefineConstants>DEBUG;TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
@@ -35,8 +36,8 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\NET35\Release</OutputPath>
- <IntermediateOutputPath>obj\NET35\Release\</IntermediateOutputPath>
+ <OutputPath>bin\Release</OutputPath>
+ <IntermediateOutputPath>obj\Release\</IntermediateOutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591, 1570, 1571, 1572, 1573, 1574</NoWarn>
<DefineConstants>TRACE;LITE;$(EnvironmentFlavor);$(EnvironmentTemplate)</DefineConstants>
@@ -87,7 +88,7 @@
<Compile Include="UninitializedMessageException.cs" />
<Compile Include="WireFormat.cs" />
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/csharp/src/ProtocolBuffers/TextFormat.cs b/csharp/src/ProtocolBuffers/TextFormat.cs
index 951cdc0e..6a9180f3 100644
--- a/csharp/src/ProtocolBuffers/TextFormat.cs
+++ b/csharp/src/ProtocolBuffers/TextFormat.cs
@@ -732,11 +732,7 @@ namespace Google.ProtocolBuffers
{
// Explicitly specify the invariant culture so that this code does not break when
// executing in Turkey.
-#if PORTABLE_LIBRARY
String lowerName = name.ToLowerInvariant();
-#else
- String lowerName = name.ToLower(FrameworkPortability.InvariantCulture);
-#endif
field = type.FindDescriptor<FieldDescriptor>(lowerName);
// If the case-insensitive match worked but the field is NOT a group,
// TODO(jonskeet): What? Java comment ends here!
diff --git a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs
index aee1b7c9..98aa04c7 100644
--- a/csharp/src/ProtocolBuffers/UnknownFieldSet.cs
+++ b/csharp/src/ProtocolBuffers/UnknownFieldSet.cs
@@ -330,12 +330,12 @@ namespace Google.ProtocolBuffers
internal Builder()
{
- fields = new SortedList<int, UnknownField>();
+ fields = new SortedDictionary<int, UnknownField>();
}
internal Builder(IDictionary<int, UnknownField> dictionary)
{
- fields = new SortedList<int, UnknownField>(dictionary);
+ fields = new SortedDictionary<int, UnknownField>(dictionary);
}
/// <summary>