Repository: thrift Updated Branches: refs/heads/master 34e0bb64b -> ab1bfa901
THRIFT-3319 CSharp tutorial will not build using the *.sln Client: C# Patch: Jens Geyer This closes #604 Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ab1bfa90 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ab1bfa90 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ab1bfa90 Branch: refs/heads/master Commit: ab1bfa90136fa0c9c778a3a312a9b762050858ef Parents: 34e0bb6 Author: Jens Geyer <[email protected]> Authored: Fri Sep 11 23:20:09 2015 +0200 Committer: Jens Geyer <[email protected]> Committed: Fri Sep 11 23:49:54 2015 +0200 ---------------------------------------------------------------------- .../csharp/CsharpClient/CsharpClient.csproj | 44 ++++++++++++++----- tutorial/csharp/CsharpServer/CsharpServer.cs | 4 +- .../csharp/CsharpServer/CsharpServer.csproj | 45 +++++++++++++++----- 3 files changed, 69 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/ab1bfa90/tutorial/csharp/CsharpClient/CsharpClient.csproj ---------------------------------------------------------------------- diff --git a/tutorial/csharp/CsharpClient/CsharpClient.csproj b/tutorial/csharp/CsharpClient/CsharpClient.csproj index afce70d..1ea7ff6 100644 --- a/tutorial/csharp/CsharpClient/CsharpClient.csproj +++ b/tutorial/csharp/CsharpClient/CsharpClient.csproj @@ -61,23 +61,45 @@ </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="Thrift, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\lib\csharp\src\bin\Release\Thrift.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> + <Compile Include="..\gen-csharp\Calculator.cs"> + <Link>Calculator.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\InvalidOperation.cs"> + <Link>InvalidOperation.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\Operation.cs"> + <Link>Operation.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\SharedService.cs"> + <Link>SharedService.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\SharedStruct.cs"> + <Link>SharedStruct.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\tutorial.Constants.cs"> + <Link>tutorial.Constants.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\Work.cs"> + <Link>Work.cs</Link> + </Compile> <Compile Include="CsharpClient.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="..\..\gen-csharp\Calculator.cs" /> - <Compile Include="..\..\gen-csharp\Constants.cs" /> - <Compile Include="..\..\gen-csharp\InvalidOperation.cs" /> - <Compile Include="..\..\gen-csharp\Operation.cs" /> - <Compile Include="..\..\gen-csharp\SharedService.cs" /> - <Compile Include="..\..\gen-csharp\SharedStruct.cs" /> - <Compile Include="..\..\gen-csharp\Work.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\lib\csharp\src\Thrift.csproj"> + <Project>{499eb63c-d74c-47e8-ae48-a2fc94538e9d}</Project> + <Name>Thrift</Name> + </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent>pushd "$(SolutionDir)" +thrift -gen csharp -r ../tutorial.thrift +popd +</PreBuildEvent> + </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"> http://git-wip-us.apache.org/repos/asf/thrift/blob/ab1bfa90/tutorial/csharp/CsharpServer/CsharpServer.cs ---------------------------------------------------------------------- diff --git a/tutorial/csharp/CsharpServer/CsharpServer.cs b/tutorial/csharp/CsharpServer/CsharpServer.cs index d32016f..439790a 100644 --- a/tutorial/csharp/CsharpServer/CsharpServer.cs +++ b/tutorial/csharp/CsharpServer/CsharpServer.cs @@ -66,7 +66,7 @@ namespace CSharpTutorial if (work.Num2 == 0) { InvalidOperation io = new InvalidOperation(); - io.What = (int)work.Op; + io.WhatOp = (int)work.Op; io.Why = "Cannot divide by 0"; throw io; } @@ -76,7 +76,7 @@ namespace CSharpTutorial default: { InvalidOperation io = new InvalidOperation(); - io.What = (int)work.Op; + io.WhatOp = (int)work.Op; io.Why = "Unknown operation"; throw io; } http://git-wip-us.apache.org/repos/asf/thrift/blob/ab1bfa90/tutorial/csharp/CsharpServer/CsharpServer.csproj ---------------------------------------------------------------------- diff --git a/tutorial/csharp/CsharpServer/CsharpServer.csproj b/tutorial/csharp/CsharpServer/CsharpServer.csproj index 0550261..0748180 100644 --- a/tutorial/csharp/CsharpServer/CsharpServer.csproj +++ b/tutorial/csharp/CsharpServer/CsharpServer.csproj @@ -61,23 +61,46 @@ </Reference> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="Thrift, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\lib\csharp\src\bin\Release\Thrift.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> + <Compile Include="..\gen-csharp\Calculator.cs"> + <Link>Calculator.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\InvalidOperation.cs"> + <Link>InvalidOperation.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\Operation.cs"> + <Link>Operation.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\SharedService.cs"> + <Link>SharedService.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\SharedStruct.cs"> + <Link>SharedStruct.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\tutorial.Constants.cs"> + <Link>tutorial.Constants.cs</Link> + </Compile> + <Compile Include="..\gen-csharp\Work.cs"> + <Link>Work.cs</Link> + </Compile> <Compile Include="CsharpServer.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="..\..\gen-csharp\Calculator.cs" /> - <Compile Include="..\..\gen-csharp\Constants.cs" /> - <Compile Include="..\..\gen-csharp\InvalidOperation.cs" /> - <Compile Include="..\..\gen-csharp\Operation.cs" /> - <Compile Include="..\..\gen-csharp\SharedService.cs" /> - <Compile Include="..\..\gen-csharp\SharedStruct.cs" /> - <Compile Include="..\..\gen-csharp\Work.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\lib\csharp\src\Thrift.csproj"> + <Project>{499eb63c-d74c-47e8-ae48-a2fc94538e9d}</Project> + <Name>Thrift</Name> + </ProjectReference> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent>pushd "$(SolutionDir)" +thrift -gen csharp -r ../tutorial.thrift +popd + +</PreBuildEvent> + </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">
