-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C#] fix net35 with JsonSubTypes #7043
Conversation
The change looks good. What are the errors present in .NET 3.5/4.0 compile scripts? These worked previously (I resolved any issues about a week or two ago), before changing to the nuget package. Are you on an older version if mono, maybe? I'll verify against this branch when I'm at a computer either tonight or tomorrow and report back with my mono version. If it's a mono version issue, we'll want to open another pr to check for a minimum version before compilation, so there's no unknowns in build scripts. That's probably a good idea, anyway. |
@jimschubert I did not try on linux/mono but on windows only. It looks like the windows scripts are at least missing the Here are the windows build.log: |
@manuc66 on Windows, I think it's a little different. If you're on Windows 10, I don't know if you'll be able to install .net 3.5 or 4.0. .net 4.5 is an in place install over .net 4.0, which may compile differently than having only .net 4.0 installed. I'll need to download the IE developer images again to check. |
If I do use msbuild instead of csc on Windows the compilation works: For net35: if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
.\nuget.exe restore
%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\msbuild IO.Swagger.sln /p:TargetFramework=3.5 See: https://pastebin.com/ZrCfdbrS For net40 I still have issue with msbuild that I don't have with VS 2017: if not exist ".\nuget.exe" powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe', '.\nuget.exe')"
.\nuget.exe restore
%SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\msbuild IO.Swagger.sln /p:TargetFramework=4.0 see: https://pastebin.com/5mCLTqn7 (in fact that's only the test library that is failing to build) |
@manuc66 were you ever able to resolve the issue with .NET 4.0? I intended to test this out but my VM drive crapped out and my main machine didn't have enough space for running a VM. I've upgraded my machine, and could take a look now if you were unable to. |
…ure/fix-net35 # Conflicts: # modules/swagger-codegen/src/main/resources/aspnetcore/project.json.mustache
@jimschubert I did not found a solution for the compilation errors that are linked to the use of csc in the compilation stage. Note that:
|
Thanks @manuc66. We plan to release 2.3.0 today or tomorrow so I hope we can this into master as well. |
I tested build.sh for the following folders and the result is good:
|
* master: move bvwells to go tech comm update current stable version in readme skip push snapshot to avoid error comment out checkstyle in circleci pom.xml comment out check style plugin Revert "update version to 2.4.0-SNAPSHOT" update ci config to install codegen locally update doc to 2.3.0 update version to 2.4.0-SNAPSHOT update version to 2.3.0 fix net35 with JsonSubTypes (swagger-api#7043) [Javascript] Set ES5 as default (swagger-api#7239) swagger-api#7201: Take the modelPropertyNaming property into account again (swagger-api#7202) add trenneman as elm creator add bvwells to go technical committee Video "Building an API with Swagger" (swagger-api#7237) [Akka-Scala] This is a fix to a bug introduced by this PR swagger-api#7172 (swagger-api#7228) Add Elm language - BETA (swagger-api#6947) bump stack resolver to lts-10.0 (swagger-api#7221)
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
As mentioned in #6969 this PR update JsonSubTypes to
1.2.0
which is compatible with NET35 without API changes.As suggested I updated
compile.mustache
In order to validate the
NET35
compliance I added a new sample generationsamples\client\petstore\csharp\SwaggerClientNet35\
Here is the compilation status of sample available in the project:
The two NOT OK are not related to this PR nor #6969 but seems to be related to the usage of
csc
cc: @mandrean, @jimschubert