Have It support "CodeContracts"?
Have It support "CodeContracts"
I via Sandcastle can generate "CodeContracts" of document https://marketplace.visualstudio.com/items?itemName=RiSEResearchinSoftwareEngineering.CodeContractsforNET
How to via docfx can generate "CodeContracts" of document?
Reading code contract spec, docfx can reflect related attributes but not support generating CodeContracts of document yet? @vwxyzh @vicancy
Hi hellosnow, I can not generate "CodeContracts" of document. I don't know docfx have support "CodeContracts"?
Docfx doesn't support CodeContracts yet, I will play on Sandcastle to try generating CodeContracts first, then try to run docfx to check whether we have reflected related attribute like ContractInvariantMethod. Our attributes in yaml file is like Attribute sample in Yaml.
Have you tried to run your project by docfx? If possible, could you share with us the yaml files?
One more, could you share with us the links about Sandcastle generated html files? We're interested on what information is needed in the final page.
I tried to generate code contracts:
- source code: https://github.com/hellosnow/ForCodeContract/tree/master/TestCodeContracts
- generated yaml files: https://github.com/hellosnow/ForCodeContract/tree/master/yaml
- generated html file snapshot:

@yaochangyu from your blog post 使用 Sandcastle 自動產生 Code Contract 說明文件, we found a snapshot to describe how it looks like using Sandcastle: 
From the above, we can come into conclusion that docfx haven't support generating section for code contracts, but already generated the attributes via ContractInvariantMethodAttribute.
If we need to support code contracts, need to update the template such as class template, much similar as exception section. @yaochangyu if you're interested in it, welcome contribute on that.
@hellosnow Hi hellosnow 使用 Sandcastle 自動產生 Code Contract 說明文件,That's my blog. How to use new feature?
@yaochangyu yes i found it from your blog.
Code contracts aren't supported in .NET 5+ (including .NET Core versions). Consider using Nullable reference types instead.