dotnet / dotnet/docfx

Multiple issues when generating docs with GitHub Actions (Process terminated due to Stackoverflow with newest versions or The SDK 'Microsoft.NET.Sdk' specified could not be found with older ones)

Open
#8,012 0 comments 0 reactions 0 assignees View on GitHub
dotnet dotnet: msbuild
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operating System**: (`Windows` or `Linux` or `MacOS`)
Windows

**DocFX Version Used**:
Multiple version starting from 2.38.1, 2.39, 2.51, 2.58
**Template used**: (`default` or `statictoc` or contain custom template)
default
**Steps to Reproduce**:

1. GitHub Actions
```
Viewed
@@ -0,0 +1,49 @@
name: DocFX Build and Deployment

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
generate-docs:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
#with:
# dotnet-version: 3.1.101

- name: Setup DocFX
uses: crazy-max/ghaction-chocolatey@v1
with:
args: install docfx --version=2.58
#run: choco install --verbose docfx

- name: Install dependencies
run: dotnet restore src/Okta.Sdk

# - name: DocFx metadata
# working-directory: docs
# run: docfx metadata ./docfx.json -l Verbose

- name: DocFX Build
working-directory: docs
run: docfx docfx.json --force
continue-on-error: false

- name: List files tree after docs build
run: tree /f

- name: Deploy Docs to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
keep_files: true
```

2. docfx.json

```
{
"metadata": [
{
"src": [
{
"files": [ "**/Okta.Sdk.csproj" ],
"exclude": [ "**/bin/**", "**/obj/**", "docs/**" ],
"src": "../"
}
],
"dest": "api",
"properties": {
"TargetFramework": "netcoreapp3.1"
},
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"toc.yml",
"*.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"resource": [
{
"files": [
"images/**"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"globalMetadata": {
"_appTitle": "Okta .NET SDK API Documentation",
"_appFooter": "Copyright © 2021 Okta, Inc.
Generated with DocFx.",
"_appLogoPath": "images/okta-dev-logo.png",
"_appFaviconPath": "images/favicon.ico",
"_disableContribution": "true"
},
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"templates/default"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}
```
> Note: My project multitargets netstandard2.0, netstandard2.1 and net core 3.1

3. Global.json

```
{
"sdk": {
"version": "3.1.101",
"rollForward": "latestMajor",
"allowPrerelease" : false
},
"msbuild-sdks": {
"Microsoft.Build.NoTargets": "1.0.53",
"Microsoft.Build.CentralPackageVersions": "2.0.36"
}
}
```
Without success, I've tried multiple things described in different closed and open issues in this repo. You can see all my attempts [here](https://github.com/okta/okta-sdk-dotnet/pull/546/commits).

**Expected Behavior**:
The docs should be generated successfully

**Actual Behavior**:
Process terminated due to Stackoverflow with newest docFx versions or The SDK 'Microsoft.NET.Sdk' specified could not be found with older ones

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.