Commit ad73b425 authored by csharptest's avatar csharptest Committed by rogerk

Fixing build for SILVERLIGHT and COMPACT_FRAMEWORK before adding more build

variations (WP).  Changes are primarily superficial since they are to support
the Serialization assembly and unit tests compiling in the CF which has not
been done before.
parent 3cf33153
 
using System; using System;
#if !SILVERLIGHT && !COMPACT_FRAMEWORK
namespace Microsoft.VisualStudio.TestTools.UnitTesting namespace Microsoft.VisualStudio.TestTools.UnitTesting
{ {
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
...@@ -50,4 +50,5 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting ...@@ -50,4 +50,5 @@ namespace Microsoft.VisualStudio.TestTools.UnitTesting
NUnit.Framework.Assert.AreEqual(b1, b2); NUnit.Framework.Assert.AreEqual(b1, b2);
} }
} }
} }
\ No newline at end of file #endif
\ No newline at end of file
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
//Disable CS3011: only CLS-compliant members can be abstract //Disable CS3011: only CLS-compliant members can be abstract
...@@ -697,5 +698,28 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -697,5 +698,28 @@ namespace Google.ProtocolBuffers.Serialization
} }
#endregion #endregion
internal static bool TryParseInt32(string text, out int number)
{
return TryParseInt32(text, NumberStyles.Any, CultureInfo.InvariantCulture, out number);
}
internal static bool TryParseInt32(string text, NumberStyles style, IFormatProvider format, out int number)
{
#if COMPACT_FRAMEWORK
try
{
number = int.Parse(text, NumberStyles.Integer, CultureInfo.InvariantCulture);
return true;
}
catch
{
number = 0;
return false;
}
#else
return int.TryParse(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out number);
#endif
}
} }
} }
\ No newline at end of file
...@@ -163,7 +163,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -163,7 +163,7 @@ namespace Google.ProtocolBuffers.Serialization
if (ReadAsText(ref text, typeof(Enum))) if (ReadAsText(ref text, typeof(Enum)))
{ {
int number; int number;
if (int.TryParse(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out number)) if (TryParseInt32(text, NumberStyles.Integer, CultureInfo.InvariantCulture, out number))
{ {
value = number; value = number;
return true; return true;
......
...@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -100,7 +100,7 @@ namespace Google.ProtocolBuffers.Serialization
private class JsonStreamWriter : JsonFormatWriter private class JsonStreamWriter : JsonFormatWriter
{ {
#if SILVERLIGHT || COMPACT_FRAMEWORK_35 #if SILVERLIGHT || COMPACT_FRAMEWORK
static readonly Encoding Encoding = new UTF8Encoding(false); static readonly Encoding Encoding = new UTF8Encoding(false);
#else #else
private static readonly Encoding Encoding = Encoding.ASCII; private static readonly Encoding Encoding = Encoding.ASCII;
......
...@@ -322,7 +322,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -322,7 +322,7 @@ namespace Google.ProtocolBuffers.Serialization
string hex = new string(new char[] {ReadChar(), ReadChar(), ReadChar(), ReadChar()}); string hex = new string(new char[] {ReadChar(), ReadChar(), ReadChar(), ReadChar()});
int result; int result;
Assert( Assert(
int.TryParse(hex, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, AbstractTextReader.TryParseInt32(hex, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture,
out result), out result),
"Expected a 4-character hex specifier."); "Expected a 4-character hex specifier.");
sb.Add((char) result); sb.Add((char) result);
......
...@@ -68,7 +68,7 @@ using System.Runtime.CompilerServices; ...@@ -68,7 +68,7 @@ using System.Runtime.CompilerServices;
// [assembly: AssemblyVersion("2.4.1.473")] // [assembly: AssemblyVersion("2.4.1.473")]
[assembly: AssemblyVersion("2.4.1.473")] [assembly: AssemblyVersion("2.4.1.473")]
#if !COMPACT_FRAMEWORK_35 #if !COMPACT_FRAMEWORK
[assembly: AssemblyFileVersion("2.4.1.473")] [assembly: AssemblyFileVersion("2.4.1.473")]
#endif #endif
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
......
...@@ -7,7 +7,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -7,7 +7,7 @@ namespace Google.ProtocolBuffers.Serialization
/// <summary> /// <summary>
/// The exception raised when a recursion limit is reached while parsing input. /// The exception raised when a recursion limit is reached while parsing input.
/// </summary> /// </summary>
#if !SILVERLIGHT #if !SILVERLIGHT && !COMPACT_FRAMEWORK
[Serializable] [Serializable]
#endif #endif
public sealed class RecursionLimitExceededException : FormatException public sealed class RecursionLimitExceededException : FormatException
...@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -18,7 +18,7 @@ namespace Google.ProtocolBuffers.Serialization
{ {
} }
#if !SILVERLIGHT #if !SILVERLIGHT && !COMPACT_FRAMEWORK
private RecursionLimitExceededException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) private RecursionLimitExceededException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context) : base(info, context)
{ {
......
...@@ -269,7 +269,7 @@ namespace Google.ProtocolBuffers.Serialization ...@@ -269,7 +269,7 @@ namespace Google.ProtocolBuffers.Serialization
{ {
int number; int number;
string temp; string temp;
if (null != (temp = _input.GetAttribute("value")) && int.TryParse(temp, out number)) if (null != (temp = _input.GetAttribute("value")) && TryParseInt32(temp, out number))
{ {
Skip(); Skip();
value = number; value = number;
......
...@@ -196,7 +196,7 @@ namespace Google.ProtocolBuffers ...@@ -196,7 +196,7 @@ namespace Google.ProtocolBuffers
0x9abcdef012345678UL); 0x9abcdef012345678UL);
} }
#if !SILVERLIGHT #if !SILVERLIGHT && !COMPACT_FRAMEWORK
[TestMethod] [TestMethod]
public void WriteWholeMessage() public void WriteWholeMessage()
{ {
......
...@@ -19,14 +19,15 @@ namespace Google.ProtocolBuffers.Compatibility ...@@ -19,14 +19,15 @@ namespace Google.ProtocolBuffers.Compatibility
TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder); TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder);
return builder; return builder;
} }
//This test can take a very long time to run.
[TestMethod, System.ComponentModel.Description("This test can take a very long time to run.")] [TestMethod]
public override void RoundTripMessage2OptimizeSize() public override void RoundTripMessage2OptimizeSize()
{ {
//base.RoundTripMessage2OptimizeSize(); //base.RoundTripMessage2OptimizeSize();
} }
[TestMethod, System.ComponentModel.Description("This test can take a very long time to run.")] //This test can take a very long time to run.
[TestMethod]
public override void RoundTripMessage2OptimizeSpeed() public override void RoundTripMessage2OptimizeSpeed()
{ {
//base.RoundTripMessage2OptimizeSpeed(); //base.RoundTripMessage2OptimizeSpeed();
......
...@@ -34,26 +34,32 @@ ...@@ -34,26 +34,32 @@
#endregion #endregion
using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors; using Google.ProtocolBuffers.Descriptors;
using NUnit.Framework; using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitTest.Issues.TestProtos; using UnitTest.Issues.TestProtos;
namespace Google.ProtocolBuffers namespace Google.ProtocolBuffers
{ {
/// <summary> /// <summary>
/// Tests for issues which aren't easily compartmentalized into other unit tests. /// Tests for issues which aren't easily compartmentalized into other unit tests.
/// </summary> /// </summary>
[TestFixture] [TestClass]
public class IssuesTest public class IssuesTest
{ {
// Issue 45 // Issue 45
[Test] [TestMethod]
public void FieldCalledItem() public void FieldCalledItem()
{ {
ItemField message = new ItemField.Builder { Item = 3 }.Build(); ItemField message = new ItemField.Builder { Item = 3 }.Build();
FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item"); FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item");
Assert.IsNotNull(field); Assert.IsNotNull(field);
Assert.AreEqual(3, message[field]); Assert.AreEqual(3, (int)message[field]);
} }
} }
} }
...@@ -38,7 +38,11 @@ using System.Runtime.InteropServices; ...@@ -38,7 +38,11 @@ using System.Runtime.InteropServices;
// [assembly: AssemblyVersion("2.4.1.473")] // [assembly: AssemblyVersion("2.4.1.473")]
[assembly: AssemblyVersion("2.4.1.473")] [assembly: AssemblyVersion("2.4.1.473")]
#if !COMPACT_FRAMEWORK
[assembly: AssemblyFileVersion("2.4.1.473")] [assembly: AssemblyFileVersion("2.4.1.473")]
#endif
// We don't really need CLSCompliance, but if the assembly builds with no warnings, // We don't really need CLSCompliance, but if the assembly builds with no warnings,
// that means the generator is okay. // that means the generator is okay.
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
...@@ -58,14 +59,25 @@ ...@@ -58,14 +59,25 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkClass)' == 'CLIENTPROFILE' ">
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath> <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" /> </ItemGroup>
<Reference Include="System" /> <ItemGroup Condition=" '$(TargetFrameworkClass)' != 'CLIENTPROFILE' ">
<Reference Include="System.Data" /> <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Xml" /> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs"> <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
...@@ -83,6 +95,7 @@ ...@@ -83,6 +95,7 @@
<Compile Include="Compatibility\TestResources.cs" /> <Compile Include="Compatibility\TestResources.cs" />
<Compile Include="Compatibility\TextCompatibilityTests.cs" /> <Compile Include="Compatibility\TextCompatibilityTests.cs" />
<Compile Include="Compatibility\XmlCompatibilityTests.cs" /> <Compile Include="Compatibility\XmlCompatibilityTests.cs" />
<Compile Include="SerializableAttribute.cs" />
<Compile Include="TestProtos\UnitTestExtrasProtoFile.cs" /> <Compile Include="TestProtos\UnitTestExtrasProtoFile.cs" />
<Compile Include="TestRpcForMimeTypes.cs" /> <Compile Include="TestRpcForMimeTypes.cs" />
<Compile Include="TestReaderForUrlEncoded.cs" /> <Compile Include="TestReaderForUrlEncoded.cs" />
......
...@@ -13,7 +13,8 @@ namespace Google.ProtocolBuffers ...@@ -13,7 +13,8 @@ namespace Google.ProtocolBuffers
[TestClass] [TestClass]
public class ReusableBuilderTest public class ReusableBuilderTest
{ {
[TestMethod, System.ComponentModel.Description("Issue 28: Circular message dependencies result in null defaults for DefaultInstance")] //Issue 28: Circular message dependencies result in null defaults for DefaultInstance
[TestMethod]
public void EnsureStaticCicularReference() public void EnsureStaticCicularReference()
{ {
MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance; MyMessageAReferenceB ab = MyMessageAReferenceB.DefaultInstance;
......
using System; #if !SILVERLIGHT && !COMPACT_FRAMEWORK
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
...@@ -175,3 +176,4 @@ namespace Google.ProtocolBuffers ...@@ -175,3 +176,4 @@ namespace Google.ProtocolBuffers
} }
} }
} }
#endif
\ No newline at end of file
...@@ -49,12 +49,11 @@ using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert; ...@@ -49,12 +49,11 @@ using Assert = Microsoft.VisualStudio.TestTools.UnitTesting.Assert;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif #endif
namespace Google.ProtocolBuffers namespace Google.ProtocolBuffers
{ {
internal static class TestUtil internal static class TestUtil
{ {
#if !SILVERLIGHT #if !SILVERLIGHT && !COMPACT_FRAMEWORK
private static string testDataDirectory; private static string testDataDirectory;
internal static string TestDataDirectory internal static string TestDataDirectory
...@@ -1769,6 +1768,9 @@ namespace Google.ProtocolBuffers ...@@ -1769,6 +1768,9 @@ namespace Google.ProtocolBuffers
public static void TestInMultipleCultures(CultureAction test) public static void TestInMultipleCultures(CultureAction test)
{ {
#if COMPACT_FRAMEWORK
test();
#else
CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture; CultureInfo originalCulture = Thread.CurrentThread.CurrentCulture;
foreach (string culture in TestCultures) foreach (string culture in TestCultures)
{ {
...@@ -1782,6 +1784,7 @@ namespace Google.ProtocolBuffers ...@@ -1782,6 +1784,7 @@ namespace Google.ProtocolBuffers
Thread.CurrentThread.CurrentCulture = originalCulture; Thread.CurrentThread.CurrentCulture = originalCulture;
} }
} }
#endif
} }
/// <summary> /// <summary>
......
...@@ -41,6 +41,7 @@ using Google.ProtocolBuffers.TestProtos; ...@@ -41,6 +41,7 @@ using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Globalization; using System.Globalization;
using System.Threading; using System.Threading;
#if !SILVERLIGHT && !COMPACT_FRAMEWORK
namespace Google.ProtocolBuffers namespace Google.ProtocolBuffers
{ {
...@@ -175,7 +176,10 @@ namespace Google.ProtocolBuffers ...@@ -175,7 +176,10 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
private static ByteString Bytes(string str) private static ByteString Bytes(string str)
{ {
return ByteString.CopyFrom(Encoding.GetEncoding(28591).GetBytes(str)); byte[] bytes = new byte[str.Length];
for (int i = 0; i < bytes.Length; i++)
bytes[i] = (byte)str[i];
return ByteString.CopyFrom(bytes);
} }
[TestMethod] [TestMethod]
...@@ -568,4 +572,5 @@ namespace Google.ProtocolBuffers ...@@ -568,4 +572,5 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(longText, builder.OptionalString); Assert.AreEqual(longText, builder.OptionalString);
} }
} }
} }
\ No newline at end of file #endif
\ No newline at end of file
...@@ -231,7 +231,7 @@ namespace Google.ProtocolBuffers ...@@ -231,7 +231,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
public bool ReadDouble(ref double value) public bool ReadDouble(ref double value)
{ {
#if SILVERLIGHT || COMPACT_FRAMEWORK_35 #if SILVERLIGHT || COMPACT_FRAMEWORK
if (BitConverter.IsLittleEndian && 8 <= bufferSize - bufferPos) if (BitConverter.IsLittleEndian && 8 <= bufferSize - bufferPos)
{ {
value = BitConverter.ToDouble(buffer, bufferPos); value = BitConverter.ToDouble(buffer, bufferPos);
......
...@@ -496,7 +496,7 @@ namespace Google.ProtocolBuffers ...@@ -496,7 +496,7 @@ namespace Google.ProtocolBuffers
/// </summary> /// </summary>
public void WriteDoubleNoTag(double value) public void WriteDoubleNoTag(double value)
{ {
#if SILVERLIGHT || COMPACT_FRAMEWORK_35 #if SILVERLIGHT || COMPACT_FRAMEWORK
byte[] rawBytes = BitConverter.GetBytes(value); byte[] rawBytes = BitConverter.GetBytes(value);
if (!BitConverter.IsLittleEndian) if (!BitConverter.IsLittleEndian)
ByteArray.Reverse(rawBytes); ByteArray.Reverse(rawBytes);
......
...@@ -40,7 +40,7 @@ using System.Runtime.Serialization; ...@@ -40,7 +40,7 @@ using System.Runtime.Serialization;
/* /*
* This entire source file is not supported on the Silverlight platform * This entire source file is not supported on the Silverlight platform
*/ */
#if !SILVERLIGHT #if !SILVERLIGHT && !COMPACT_FRAMEWORK
namespace Google.ProtocolBuffers namespace Google.ProtocolBuffers
{ {
/* /*
......
...@@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers ...@@ -98,7 +98,7 @@ namespace Google.ProtocolBuffers
public EnumLiteMap() public EnumLiteMap()
{ {
items = new SortedList<int, IEnumLite>(); items = new SortedList<int, IEnumLite>();
#if SILVERLIGHT #if SILVERLIGHT || COMPACT_FRAMEWORK
// Silverlight doesn't support Enum.GetValues // Silverlight doesn't support Enum.GetValues
// TODO(jonskeet): Validate that this reflection is permitted, e.g. in Windows Phone 7 // TODO(jonskeet): Validate that this reflection is permitted, e.g. in Windows Phone 7
foreach (System.Reflection.FieldInfo fi in typeof(TEnum).GetFields(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public)) foreach (System.Reflection.FieldInfo fi in typeof(TEnum).GetFields(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public))
......
...@@ -68,7 +68,7 @@ using System.Runtime.CompilerServices; ...@@ -68,7 +68,7 @@ using System.Runtime.CompilerServices;
// [assembly: AssemblyVersion("2.4.1.473")] // [assembly: AssemblyVersion("2.4.1.473")]
[assembly: AssemblyVersion("2.4.1.473")] [assembly: AssemblyVersion("2.4.1.473")]
#if !COMPACT_FRAMEWORK_35 #if !COMPACT_FRAMEWORK
[assembly: AssemblyFileVersion("2.4.1.473")] [assembly: AssemblyFileVersion("2.4.1.473")]
#endif #endif
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
......
...@@ -82,7 +82,7 @@ namespace Google.ProtocolBuffers ...@@ -82,7 +82,7 @@ namespace Google.ProtocolBuffers
public static Exception CreateMissingMethod(Type type, string methodName) public static Exception CreateMissingMethod(Type type, string methodName)
{ {
#if SILVERLIGHT #if SILVERLIGHT || COMPACT_FRAMEWORK
return new MissingMethodException(String.Format("The method '{0}' was not found on type {1}", methodName, type)); return new MissingMethodException(String.Format("The method '{0}' was not found on type {1}", methodName, type));
#else #else
return new MissingMethodException(String.Format("{0}", type), methodName); return new MissingMethodException(String.Format("{0}", type), methodName);
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
...@@ -39,14 +40,25 @@ ...@@ -39,14 +40,25 @@
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkClass)' == 'CLIENTPROFILE' ">
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath> <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" /> </ItemGroup>
<Reference Include="System" /> <ItemGroup Condition=" '$(TargetFrameworkClass)' != 'CLIENTPROFILE' ">
<Reference Include="System.Data" /> <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Xml" /> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs"> <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
...@@ -66,6 +78,7 @@ ...@@ -66,6 +78,7 @@
<Compile Include="ExtendableBuilderLiteTest.cs" /> <Compile Include="ExtendableBuilderLiteTest.cs" />
<Compile Include="ExtendableMessageLiteTest.cs" /> <Compile Include="ExtendableMessageLiteTest.cs" />
<Compile Include="LiteTest.cs" /> <Compile Include="LiteTest.cs" />
<Compile Include="SerializableAttribute.cs" />
<Compile Include="SerializableLiteTest.cs" /> <Compile Include="SerializableLiteTest.cs" />
<Compile Include="TestLiteByApi.cs" /> <Compile Include="TestLiteByApi.cs" />
<Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" /> <Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" />
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<TargetFrameworkClass>CLIENTPROFILE</TargetFrameworkClass>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
...@@ -39,14 +40,25 @@ ...@@ -39,14 +40,25 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkClass)' == 'CLIENTPROFILE' ">
<Reference Include="nunit.framework"> <Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath> <HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" /> </ItemGroup>
<Reference Include="System" /> <ItemGroup Condition=" '$(TargetFrameworkClass)' != 'CLIENTPROFILE' ">
<Reference Include="System.Data" /> <Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Xml" /> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs"> <Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
...@@ -62,6 +74,7 @@ ...@@ -62,6 +74,7 @@
<Compile Include="InteropLiteTest.cs" /> <Compile Include="InteropLiteTest.cs" />
<Compile Include="LiteTest.cs" /> <Compile Include="LiteTest.cs" />
<Compile Include="MissingFieldAndExtensionTest.cs" /> <Compile Include="MissingFieldAndExtensionTest.cs" />
<Compile Include="SerializableAttribute.cs" />
<Compile Include="TestLiteByApi.cs" /> <Compile Include="TestLiteByApi.cs" />
<Compile Include="TestProtos\UnitTestExtrasFullProtoFile.cs" /> <Compile Include="TestProtos\UnitTestExtrasFullProtoFile.cs" />
<Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" /> <Compile Include="TestProtos\UnitTestExtrasLiteProtoFile.cs" />
......
using System; using System;
#if !SILVERLIGHT && !COMPACT_FRAMEWORK
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Runtime.Serialization; using System.Runtime.Serialization;
...@@ -51,3 +52,4 @@ namespace Google.ProtocolBuffers ...@@ -51,3 +52,4 @@ namespace Google.ProtocolBuffers
} }
} }
} }
#endif
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment