Skip to content

Commit 1d57e70

Browse files
committed
[csharp] Set RestSharp to 105.1.0 due to bug in newer versions
1 parent 0f6038f commit 1d57e70

File tree

9 files changed

+11
-8
lines changed

9 files changed

+11
-8
lines changed

modules/swagger-codegen/src/main/resources/csharp/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
- [RestSharp] (https://www.nuget.org/packages/RestSharp) - 105.1.0 or later
77
- [Json.NET] (https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later
88

9-
NOTE: The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
9+
The DLLs included in the package may not be the latest version. We recommned using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages:
1010
```
1111
Install-Package RestSharp
1212
Install-Package Newtonsoft.Json
1313
```
1414

15+
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742)
16+
1517
## Installation
1618
Run the following command to generate the DLL
1719
- [Mac/Linux] compile-mono.sh

modules/swagger-codegen/src/main/resources/csharp/compile-mono.sh.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mono nuget.exe install vendor/packages.config -o vendor;
88
mkdir -p bin;
99

1010
cp vendor/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
11-
cp vendor/RestSharp.105.2.3/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
11+
cp vendor/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll;
1212

1313
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
1414
bin/RestSharp.dll,\

modules/swagger-codegen/src/main/resources/csharp/compile.mustache

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient
77
.\nuget.exe install vendor/packages.config -o vendor
88

99
cp vendor/Newtonsoft.Json.8.0.2/lib/{{targetFrameworkNuget}}/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
10-
cp vendor/RestSharp.105.2.3/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll
10+
cp vendor/RestSharp.105.1.0/lib/{{targetFrameworkNuget}}/RestSharp.dll bin/RestSharp.dll
1111

1212
%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/{{packageName}}.dll /recurse:src\*.cs /doc:bin/{{packageName}}.xml
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="RestSharp" version="105.2.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
3+
<package id="RestSharp" version="105.1.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
44
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
55
</packages>

samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mono nuget.exe install vendor/packages.config -o vendor;
88
mkdir -p bin;
99

1010
cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll;
11-
cp vendor/RestSharp.105.2.3/lib/net45/RestSharp.dll bin/RestSharp.dll;
11+
cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll;
1212

1313
mcs -sdk:${netfx} -r:bin/Newtonsoft.Json.dll,\
1414
bin/RestSharp.dll,\
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
@echo off
2+
23
SET CSCPATH=%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319
34

5+
46
if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://nuget.org/nuget.exe', '.\nuget.exe')"
57
.\nuget.exe install vendor/packages.config -o vendor
68

79
cp vendor/Newtonsoft.Json.8.0.2/lib/net45/Newtonsoft.Json.dll bin/Newtonsoft.Json.dll
8-
cp vendor/RestSharp.105.2.3/lib/net45/RestSharp.dll bin/RestSharp.dll
10+
cp vendor/RestSharp.105.1.0/lib/net45/RestSharp.dll bin/RestSharp.dll
911

1012
%CSCPATH%\csc /reference:bin/Newtonsoft.Json.dll;bin/RestSharp.dll /target:library /out:bin/IO.Swagger.dll /recurse:src\*.cs /doc:bin/IO.Swagger.xml

samples/client/petstore/csharp/SwaggerClientTest/Lib/SwaggerClient/src/main/csharp/IO/Swagger/Properties/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3-
using System.Windows;
43

54
// General Information about an assembly is controlled through the following
65
// set of attributes. Change these attribute values to modify the information
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="RestSharp" version="105.2.3" targetFramework="net45" developmentDependency="true" />
3+
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
44
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net45" developmentDependency="true" />
55
</packages>

0 commit comments

Comments
 (0)