Is there a way to generate documentation for only updated files using Sandcastle Help File Builder tool? - documentation-generation

I am using Sandcastle help file builder to generate documentation of a project. I added project DLL to the SHFB and it generates documentation for entire project. This process is taking around 10 minutes. I was wondering if it is possible for SHFB to look only for files which have changed in the project and update the documentation based on that so the time to generate entire documentation is not so much on every single run. If there is any plugin available to do that, that could help too.

Related

c# DocFx. Direct way to create the web page or pdf of documentation?

I have my visual studio 2022 project with c# and I want to create the documentation but I don't want more files and folders to my project.
Docfx create folders and files.
SandCastle you even have to create another project inside your solution.
There is a way to run a command and generate the web page without creating any extra file in the project/solution?
Thanks.
If you are just wanting to generate documentation from your source code xml comments than DocFx does not require that many new files to be be checked into source control. Sure you will need the basic project structure but all the intermediate / generated files in the output can be excluded from your committed source code using .gitignore files (assuming you are using git).
For example, in these tutorials
https://dotnet.github.io/docfx/tutorial/walkthrough/walkthrough_create_a_docfx_project_2.html
https://dotnet.github.io/docfx/tutorial/walkthrough/walkthrough_create_a_docfx_project.html
You would only really need
docfx.json
index.md
toc.yml
api/index.md
api.index.yml
.gitignore
If you add the following lines to the generated .gitignore from tutorial 1 then all the intermediate and generated documentation yml files will never be committed to git.
api/*.yml
api/.manifest
Hopefully this helps, I know it does not get you 0 extra files like you asked but its a fairly light weight solution to generating api documentation.

Is there a way to have sonarqube ignore an entire file from inside the (C#) code file

I'm wresting with SonarQube reporting errors on C# files which I didn't write. For example, I might import a particular piece of code from an open source library where I didn't want to take the entire library as a dependency.
This usually raises a lot of SQ warnings.
Instead of dealing with these one by one, is there a way to just mark the entire file to be ignored? I'n thinking something similar to the new #nullable disable directive.
Thanks very much.
Yes, there is way to remove or better to say exclude the particular files from being analysed by sonarqube.
You can use the sonar.exclusionswhich is a sonar analysis parameter, using this parameter you can exclude files or folders.
Here is the article from sonarqube on this https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/

How to write code in multiple projects in one solution at once? [Visual Studio/Xamarin]

I have a solution where I have multiple projects. Right now I have 3 different .sln-files that I have connected to their own .csproj and when I want to work with one of the apps I just launch that particular .sln-file and it works very well. The only problem I have now is that these 3 projects share tons of code so I look to create a solution where I can write code in one of the projects where the code would also get written in the other projects. They share the same files, filenames etc. The only difference is essentially the images, icons etc. When I did some quick research I came across this quote:
”A project can be referenced by multiple solutions. Put your library or core code into one project, then reference that project in both solutions.”
I guess some additional references/adjustments has to be made in each of the .csproj-files and .stl-files?
What i was thinking in my head is that when new code is written then that file should overwrite the same file from the other projects with the updated code. How this solution would be made is something i however do not know.
Any code examples, tips, tricks, guidance is very appreciated.
How to write code in multiple projects in one solution at once? [Visual Studio/Xamarin]
You can create a project to include the shared tons of code, then add this project to other solutions. Then when new code is written then that file should overwrite the same file from the other projects with the updated code.
To accomplish this, please check following test sample for detail:
Create a project with shared code, for example, ShareProject with following code:
public void test()
{
System.Console.Write("This is only for Test update1");
}
Create a solution1, Add->existing project..., select the ShareProject.
Create a solution2, Add->existing project..., select the ShareProject.
Update code in the shareProject.
With this setting, when new code is written then that file should overwrite the same file from the other projects with the updated code.

What is the $RANDOM_SEED$ file generated by Visual Studio build of C# solution?

We noticed that on a certain dev machine a Visual Studio (2015 update 3) debug build of a C# solution was generating a $RANDOM_SEED$ file alongside every built DLL.
The content of the file is just a single number e.g.
1443972318
Deleting the file(s) then rebuilding resulted in the file being regenerated, with a different number.
This behaviour was also observed when rebuilding a single project in the solution (one which has only the standard C# project refs/dependencies + System.Management).
Note that running a command line build e.g.
msbuild <sln-file>
did not regenerate the file (for build of complete solution or single project).
After a restart of VS, the file is no longer regenerated.
As far as we know this file name is not used in any of our source code, post build steps or internal dependencies.
There are quite a few dependencies on .NET framework classes, including Random and RNGCryptoServiceProvider, and also external dependencies. We don't have complete source code for all these so it's not possible to check exhaustively which if any of the dependencies are responsible.
This is a bit of a shot in the dark but the question is has anyone seen anything similar to this?
EDIT
I'm not surprised this has been downvoted - I appreciate it is pretty open ended, but as I'm currently not able to reproduce this and as it could have potentially serious consequences (random number generator attack?) I have posted it anyway. If I am able to repro I will of course update here.
I have the same file.
After a short investigation I found guilty:
this file is created by NUnit 3.x test adapter.
(You can check it in AdapterSettings.cs from NUnit adapter source code).
The file is used by NUnit to ensure that we use the same random seed value for generating random test cases in both the discovery and execution processes. This is required because the IDE uses two different processes to execute the adapter. It's not actually required (or created) when running the adapter under vstest.console.exe.

How is an ActiveX wrapper created with FireBreath?

I've been through the Windows and Mac video tutorials on the FireBreath (FB) website, through all the documentation and even seen the ActiveX example that a person has provided.
It's been an entire week, but I still can't understand how to create a new project in FB. The only thing explained on the website is how to get the FB sln compiled, where the PluginTest example is already coded. Even for the ActiveX example, only the code is given. It isn't explained as to how they created the project.
So how do I create a new project in FB? Should I just take the existing FB sln file and create a new empty project in it? How do I know what classes I should add to the project? How do I edit cmakeLists.txt to recognize my project? How does running prep2010.cmd make my newly added project compile?
If I need to create a wrapper for my ActiveX, how do I go about creating that project in Windows?
If you have been through the windows video tutorials and didn't see how to create a new project then you were obviously not paying attention. The first video tutorial on both windows and mac tells you how to use fbgen to create a new project.
To get text instructions, you can find them fairly easily:
Go to http://firebreath.org and click on "Getting Started". Scroll down to "Creating a new plugin project" and click on the link.
Either method will walk you through essentially the following steps:
1) Install cmake, visual studio, and python (if you don't have any of them)
2) Get FireBreath (the video tutorials suggest using git; I made the tutorials, so you can guess my suggested method).
3) Run fbgen.py with python and follow the steps.
Congratulations! You have now created a new plugin project!
To build it, you'll need to run the prep script appropriate for your platform and then open the build/FireBreath.(sln | xcodeproj) file in (visual studio | xcode). Note that this differs a bit depending on whether you're on Windows or Mac.
The prep script (such as prep2010.cmd) does not make your project compile; instead it uses cmake to generate the project files for that project for your computer which can then be used to build the project, as explained in the pages linked above. You should never modify anything in the build directory directly, instead you should modify the CMakeLists.txt file in your project directory or if you have platform-specific changes you need to make you can modify Win/projectDef.cmake and Mac/projectDef.cmake.
FireBreath.org is a wiki, so feel free to help us make these things easier to find; as you can see from the links all of the information is there. To me it seems easy to find, so obviously I'm not a good one to try to fix the problem (since I can't see it).
As for making an ActiveX wrapper, there is an example of doing this but it's not really something that is just "easy to do". FireBreath does not in any way attempt to make this a simple thing to do -- that's not the purpose of FireBreath. FireBreath is simply a framework for creating browser plugins; if you want your plugin to act as an activex wrapper you'll have to implement all of the activex for containing your control yourself.
Hopefully that's enough information to get you started. If you are confused, please go read those links. If you're still confused, read them again -- all of this information is there. If you're still confused, come ask in the FireBreath chat room on IRC and I'll try to help you figure it out.

Resources