Skip to content
Browse files

using Newtonsoft.Json

  • Loading branch information...
1 parent c7b6c6c commit 1864a14242aa1f3fef4d345bcd33379b46696855 @adrianaisemberg committed Feb 11, 2012
View
18 CLAP.sln
@@ -15,9 +15,6 @@ Global
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
- ReleaseFW2|Any CPU = ReleaseFW2|Any CPU
- ReleaseFW2|Mixed Platforms = ReleaseFW2|Mixed Platforms
- ReleaseFW2|x86 = ReleaseFW2|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -30,11 +27,6 @@ Global
{AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.Release|x86.ActiveCfg = Release|Any CPU
- {AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.ReleaseFW2|Any CPU.ActiveCfg = ReleaseFW2|Any CPU
- {AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.ReleaseFW2|Any CPU.Build.0 = ReleaseFW2|Any CPU
- {AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.ReleaseFW2|Mixed Platforms.ActiveCfg = ReleaseFW2|Any CPU
- {AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.ReleaseFW2|Mixed Platforms.Build.0 = ReleaseFW2|Any CPU
- {AE79CD7B-DFFC-4156-913E-63F70A31B7C1}.ReleaseFW2|x86.ActiveCfg = ReleaseFW2|Any CPU
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Debug|Any CPU.ActiveCfg = Debug|x86
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Debug|Any CPU.Build.0 = Debug|x86
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
@@ -47,11 +39,6 @@ Global
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Release|Mixed Platforms.Build.0 = Release|x86
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Release|x86.ActiveCfg = Release|x86
{678F4788-6950-4FE2-B471-99AB9E5B4BE9}.Release|x86.Build.0 = Release|x86
- {678F4788-6950-4FE2-B471-99AB9E5B4BE9}.ReleaseFW2|Any CPU.ActiveCfg = ReleaseFW2|x86
- {678F4788-6950-4FE2-B471-99AB9E5B4BE9}.ReleaseFW2|Any CPU.Build.0 = ReleaseFW2|x86
- {678F4788-6950-4FE2-B471-99AB9E5B4BE9}.ReleaseFW2|Mixed Platforms.ActiveCfg = ReleaseFW2|x86
- {678F4788-6950-4FE2-B471-99AB9E5B4BE9}.ReleaseFW2|Mixed Platforms.Build.0 = ReleaseFW2|x86
- {678F4788-6950-4FE2-B471-99AB9E5B4BE9}.ReleaseFW2|x86.ActiveCfg = ReleaseFW2|x86
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@@ -62,11 +49,6 @@ Global
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{63D887CB-655A-4FA1-A8B8-38A28613A707}.Release|x86.ActiveCfg = Release|Any CPU
- {63D887CB-655A-4FA1-A8B8-38A28613A707}.ReleaseFW2|Any CPU.ActiveCfg = ReleaseFW2|Any CPU
- {63D887CB-655A-4FA1-A8B8-38A28613A707}.ReleaseFW2|Any CPU.Build.0 = ReleaseFW2|Any CPU
- {63D887CB-655A-4FA1-A8B8-38A28613A707}.ReleaseFW2|Mixed Platforms.ActiveCfg = ReleaseFW2|Any CPU
- {63D887CB-655A-4FA1-A8B8-38A28613A707}.ReleaseFW2|Mixed Platforms.Build.0 = ReleaseFW2|Any CPU
- {63D887CB-655A-4FA1-A8B8-38A28613A707}.ReleaseFW2|x86.ActiveCfg = ReleaseFW2|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
56 CLAP/CLAP.csproj
@@ -10,8 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CLAP</RootNamespace>
<AssemblyName>CLAP</AssemblyName>
- <TargetFrameworkVersion Condition=" '$(Configuration)' == 'ReleaseFW2' ">v2.0</TargetFrameworkVersion>
- <TargetFrameworkVersion Condition=" '$(Configuration)' != 'ReleaseFW2' ">v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
@@ -40,7 +39,7 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Debug\CLAP.XML</DocumentationFile>
- <NoWarn>1591</NoWarn>
+ <NoWarn>1591,1685</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -51,32 +50,17 @@
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\CLAP.XML</DocumentationFile>
- <NoWarn>1591</NoWarn>
+ <NoWarn>1591,1685</NoWarn>
</PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseFW2|AnyCPU'">
- <OutputPath>bin\ReleaseFW2\</OutputPath>
- <DefineConstants>TRACE;FW2</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <CodeAnalysisLogFile>bin\Release\CLAP.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
- <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
- <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
- <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
- <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
- <DocumentationFile>bin\ReleaseFW2\CLAP.XML</DocumentationFile>
- <NoWarn>1591</NoWarn>
- <DebugSymbols>true</DebugSymbols>
+ <PropertyGroup>
+ <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Newtonsoft.Json, Version=4.0.7.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>Newtonsoft.Json\Newtonsoft.Json.dll</HintPath>
+ </Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
- <Reference Condition=" '$(Configuration)' != 'ReleaseFW2'" Include="System.Web.Extensions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
@@ -128,24 +112,14 @@
<Compile Include="ValuesFactory.cs" />
<Compile Include="VerbAttribute.cs" />
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>rd /q /s $(ProjectDir)Publish\merged_$(ConfigurationName)
+md $(ProjectDir)Publish\merged_$(ConfigurationName)
+$(ProjectDir)Publish\ilmerge /out:$(ProjectDir)Publish\merged_$(ConfigurationName)\CLAP.dll /internalize $(TargetPath) $(TargetDir)Newtonsoft.Json.dll
+copy $(TargetDir)CLAP.xml $(ProjectDir)Publish\merged_$(ConfigurationName)
+copy $(TargetDir)CLAP.pdb $(ProjectDir)Publish\merged_$(ConfigurationName)</PostBuildEvent>
+ </PropertyGroup>
<!-- 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">
View
10 CLAP/FW2Stuff.cs
@@ -1,8 +1,6 @@
-#if FW2
-
-using System.Collections.Generic;
+using System;
using System.Collections;
-using System;
+using System.Collections.Generic;
namespace CLAP
{
@@ -290,6 +288,4 @@ namespace System.Runtime.CompilerServices
internal class ExtensionAttribute : Attribute
{
}
-}
-
-#endif
+}
View
6 CLAP/HelpGenerator.cs
@@ -1,12 +1,6 @@
using System;
using System.Reflection;
using System.Text;
-using System.Diagnostics;
-using System.Collections;
-
-#if !FW2
-using System.Linq;
-#endif
namespace CLAP
{
View
4 CLAP/MultiParser.cs
@@ -1,10 +1,6 @@
using System;
using System.Diagnostics;
-#if !FW2
-using System.Linq;
-#endif
-
namespace CLAP
{
/// <summary>
View
4 CLAP/ParametersExpressionValidator.cs
@@ -1,9 +1,5 @@
using System.Data;
-#if !FW2
-using System.Linq;
-#endif
-
namespace CLAP
{
/// <summary>
View
4 CLAP/Parser.cs
@@ -1,10 +1,6 @@
using System;
using System.Diagnostics;
-#if !FW2
-using System.Linq;
-#endif
-
namespace CLAP
{
/// <summary>
View
4 CLAP/ParserRunner.cs
@@ -4,10 +4,6 @@
using System.Reflection;
using CLAP.Interception;
-#if !FW2
-using System.Linq;
-#endif
-
namespace CLAP
{
internal class ParserRunner
View
4 CLAP/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("3.4.1.0")]
-[assembly: AssemblyFileVersion("3.4.1.0")]
+[assembly: AssemblyVersion("3.5.4.0")]
+[assembly: AssemblyFileVersion("3.5.4.0")]
View
6 CLAP/Publish/pack.cmd
@@ -2,10 +2,8 @@
set PACKPATH=%~dp0_nuget_pack
rd /q /s %PACKPATH%
md %PACKPATH%\lib\net20
-md %PACKPATH%\lib\net35
-copy %~dp0..\bin\ReleaseFW2\CLAP.??? %PACKPATH%\lib\net20
-copy %~dp0..\bin\Release\CLAP.??? %PACKPATH%\lib\net35
-copy %~dp0..\CLAP.nuspec %PACKPATH%
+copy %~dp0merged_Release\CLAP.??? %PACKPATH%\lib\net20
+copy %~dp0CLAP.nuspec %PACKPATH%
getver %PACKPATH%\lib\net20\CLAP.dll > _ver
set /p VERSION= < _ver
View
24 CLAP/Serialization.cs
@@ -1,10 +1,7 @@
using System;
using System.IO;
using System.Xml.Serialization;
-
-#if !FW2
-using System.Web.Script.Serialization;
-#endif
+using Newtonsoft.Json;
namespace CLAP
{
@@ -23,12 +20,6 @@ public static bool Deserialize(string str, Type type, ref object obj)
return true;
}
-#if FW2
- else
- {
- return false;
- }
-#else
else if (str.StartsWith(new[] { "{", "[" }))
{
obj = DeserializeJson(str, type);
@@ -37,23 +28,12 @@ public static bool Deserialize(string str, Type type, ref object obj)
}
return false;
-#endif
}
-#if !FW2
private static object DeserializeJson(string json, Type type)
{
- var serializer = new JavaScriptSerializer();
-
- var method = serializer.GetType().
- GetMethod("Deserialize", new[] { typeof(string) }).
- MakeGenericMethod(type);
-
- var obj = method.Invoke(serializer, new[] { json });
-
- return obj;
+ return JsonConvert.DeserializeObject(json, type);
}
-#endif
public static object DeserializeXml(string xml, Type type)
{
View
8 CLAP/TypeValidator.cs
@@ -1,11 +1,7 @@
-using System.Diagnostics;
+using System.Collections;
+using System.Diagnostics;
using System.Reflection;
-#if !FW2
-using System.Linq;
-using System.Collections;
-#endif
-
namespace CLAP
{
internal static class TypeValidator
View
4 CLAP/Utils.cs
@@ -2,10 +2,6 @@
using System.Collections.Generic;
using System.Reflection;
-#if !FW2
-using System.Linq;
-#endif
-
namespace CLAP
{
internal static class Utils
View
6 CLAP/ValuesFactory.cs
@@ -1,12 +1,8 @@
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Reflection;
using CLAP.Interception;
-using System.ComponentModel;
-
-#if !FW2
-using System.Linq;
-#endif
namespace CLAP
{
View
38 ConsoleTest/ConsoleTest.csproj
@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ConsoleTest</RootNamespace>
<AssemblyName>myexe</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
@@ -39,6 +39,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1685</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -49,23 +50,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseFW2|x86'">
- <OutputPath>bin\x86\ReleaseFW2\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisLogFile>bin\Release\myexe.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
- <CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
- <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
- <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
- <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+ <NoWarn>1685</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -83,23 +68,6 @@
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.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.
View
2 ConsoleTest/app.config
@@ -1,3 +1,3 @@
<?xml version="1.0"?>
<configuration>
-<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
View
2 Tests/Tests.csproj
@@ -45,6 +45,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1685</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -54,6 +55,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <NoWarn>1685</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ReleaseFW2|AnyCPU'">
<OutputPath>bin\ReleaseFW2\</OutputPath>

0 comments on commit 1864a14

Please sign in to comment.
Something went wrong with that request. Please try again.