Getting Microsoft's DocFX to work in Visual Studio - c#

I downloaded DocFX and installed it from http://dotnet.github.io/docfx/.
I added it to my environment path. I then downloaded the sample solution from https://github.com/docascode/docfx-seed and opened it as a website project. (This sample already contains the package docfx.msbuild)
The documentation says to build the solution and then browse the _src folder for the website. I do this and the solution builds fine:
------ Build started: Project: docfx-seed-master, Configuration: Debug Any CPU ------ Validating Web Site Building directory
'/src/SampleClass1/BaseClass/obj/Debug/'. Building directory
'/src/SampleClass1/BaseClass/Properties/'. Building directory
'/src/SampleClass1/BaseClass/'. Building directory
'/src/SampleClass1/CatLibrary/obj/Debug/'. Building directory
'/src/SampleClass1/CatLibrary/Properties/'. Building directory
'/src/SampleClass1/CatLibrary/'. Building directory
'/src/SampleClass1/SomeVbClass/My Project/'. Building directory
'/src/SampleClass1/SomeVbClass/'.
Validation Complete
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
but there is no generated _src folder. If I however run docfx from the command line then I do indeed get a _src folder and I can browse the generated website.
So my integration of DocFX into VS2015 via MSBuild is somehow broken. Can anyone shed any light on how to get this working?

Related

how to setup Teamcity (2021.2.2) deploy app with clickonce

I have a simple wpf/console app build that I want to deploy and be able to update where ever it is installed. So I picked clickonce, from ms, because that seamed to fit my needs.
I can build, deploy, install and update it manually quite fine ;-) but when I move to do the same steps on my teamcity build server, i ran into trouble.
I have a very simpel pipeline.
build the app (works fine)
make the setup.exe, to be installed.. <= trouble !!
copy to an ISS hosted website.
ad 1) my build:
ad 2) my make click once....
If I run through step 2 manually in visual studio on the buildserver, it works. I get the binaries published in a folder. That I can copy to the IIS folder. but nothing is produced with TeamCity !!!
what am I doing wrong?
(the trace looks like there are no files, to work with. they are gone somehow...)
8x--------
lines pasted in from teamcity log
in directory: C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe
17:14:49 Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
17:14:49 Copyright (C) Microsoft Corporation. All rights reserved.
17:14:49
17:14:50 Build started 27/01/2022 17.14.50.
17:14:50 0>Process = "C:\Program Files\dotnet\dotnet.exe"
17:14:50 MSBuild executable path = "C:\Program Files\dotnet\sdk\5.0.404\MSBuild.dll"
17:14:50 Command line arguments = ""C:\Program Files\dotnet\sdk\5.0.404\MSBuild.dll" -maxcpucount -verbosity:m -target:Publish -property:TargetFramework=net5.0 -property:Configuration=Release -property:VersionSuffix=187 -property:NoBuild=true C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe\TeamCityNugetTest.sln #C:\TeamCity\BuildAgent1\temp\agentTmp\2.rsp"
17:14:50 Current directory = "C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe"
17:14:50 MSBuild version = "16.11.2+f32259642"
17:14:50 Project "TeamCityNugetTest.sln": Publish
I would suggest you define your output directory to a location outside of:
C:\TeamCity\BuildAgent1\work\4c50753a43ea36fe
I assume TeamCity is trying to put the outputs in \bin, as happens on a normal build/publish, unless you specify the output elsewhere. And if your repository doesn't contain \bin, it won't have an actual place to put it when it's done.
Also, you could probably just do the second build step. I believe dotnet publish will build the project/solution anyway.

Generation of the sonar-properties file failed. Unable to complete SonarQube analysis

Application Stack
Jenkins
.NET 4.7
SonarQube 7.4
Bitbucket (Source control)
VS 2015 Update 3
VsTest to execute UnitTest
Path of Msbuid in Global Tools Configuration is
C:\Program Files (x86)\MSBuild\14.0\Bin\Msbuild.exe
Also tried with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Msbuild.exe
We have created sample project and configured all in one server.
We can see multiple kind of errors in log files like
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
WARNING: File 'C:\Program Files (x86)\Jenkins\workspace\CICD\UnitTestProject1\Properties\AssemblyInfo.cs' is not located under the root directory 'C:\Program Files (x86)\Jenkins\workspace\CICD.sonarqube\out' and will not be analyzed
No analysable projects were found. SonarQube analysis will not be performed
This only comes when i use msbuild from "Program files" An instance of analyzer SonarAnalyzer.Rules.CSharp.FieldsShouldNotBePublic cannot be created from C:\Users\manish.joisar\AppData\Local\Temp.sonarqube\resources\0\SonarAnalyzer.CSharp.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=1.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies
I can see message with build succeeded.
I can also see successful test run message
Total tests: 1. Passed: 1. Failed: 0. Skipped: 0.
Test Run Successful.
Sonar configuration is done in build configuration under "Execute Sonar scanner" step
I am not sure what is missing here, wrong configuration, wrong msbuild ??
I suppose you have gone through this documentation https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild for getting all the dependencies information and the command required to run the analysis.
I was getting some of the error mentioned above when i was trying to analyse c# files but i require more information to understand your case so please provide the o/p of each steps mentioned below:
SonarScanner.MSBuild.exe begin /k:"project-key"
MSBuild.exe <path to solution.sln> /t:Rebuild
SonarScanner.MSBuild.exe end
If you are running through jenkins MSBuild plugin, then please provide the verbose output of the same.
I solved all above issues with below configuration in Jenkins
SonarQube configuration
Jenkin Global tool configuration
Freestyle project configuration

Xamarin UWP release mode Error - ILT005 returned exit code 1

I am developing Xamarin UWP app for Active Directory login. This application builds well in Debug mode but in Release mode it is throwing below error.
Severity Code Description Project File Line Suppression State
Error ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\ NuGetPackagesFallback\ microsoft.net.native.compiler\ 1.7.3\ tools\ x86\ilc\Tools\Gatekeeper.exe #"I:...\obj\x86\Release\ilc\intermediate\gkargs.rsp"' returned exit code 1 SampleWinApp
I am using VS 2017 and had installed two Nuget packages
1) Microsoft.IdentityModel.Clients.ActiveDirectory Version - 3.19.2
2) Microsoft.NETCore.UniversalWindowsPlatform Version - 6.0.8
I have been facing this problem since many days and had tried to search for solution on almost every site but did not find any proper solution.
Any help will highly appreciated.
Thanks.
Severity Code Description Project File Line Suppression State Error ILT0005: 'C:\Program Files (x86)\Microsoft SDKs\ NuGetPackagesFallback\ microsoft.net.native.compiler\ 1.7.3\ tools\ x86\ilc\Tools\Gatekeeper.exe #"I:...\obj\x86\Release\ilc\intermediate\gkargs.rsp"' returned exit code 1 SampleWinApp
Please try to uncheck Compile with .Net Native tool chain option in project property. It will work.

Error deploying to AWS through visual studio

My co-worker is able to deploy our projects to AWS Elastic beanstalk fine. However I have issues on both my work machine and my home laptop. Both computers have the same error in AWS window pane.
I get a pop up as follows:
Deployment of the website failed due to errors during build of the deployment archive,
check visual studio output window 'Build' and/ or 'Amazon Web Service' panes for more details.
Then in the amazon window pane I get a different error everytime I try to run the deployment.
Example 1:
...package build 'CopyPipelineFiles': error in 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets' at (1413,5): Copying file Web.config to obj\AmazonDev\TransformWebConfig\original\Web.config failed. Could not find file 'Web.config'.
Example 2:
...package build 'TransformXml': error in 'C:\Users\Andrew\colony\colony-website\Colony.Web\Colony.Web.csproj' at (840,5): Could not open Transform file: Could not find file 'C:\Users\Andrew\colony\colony-website\Colony.Model\Web.AmazonDev.config'.
Seems to be a different error each time -- I'm not sure how to even begin to look for any issues.
Jim Flangagan's comment is the answer: ReSharper 8.2 is causing this problem. To resolve either disable resharper ( Tools>Options>ReSharper>General>Suspend Now) or upgrade Resharper.

Build step failing for TeamCity and Team Foundation Server 2012

Updated with images.
When setting up a project in TeamCity, I cannot get the build step to work. I get the same
error every time.
Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\Solution.sln
I am able to connect to the TFS. Where I put the root as following.
$/Projectname/
Testing the connection returns ok.
When creating the build step I use MSBuild and set the Build file path to where the solution exists in the tfs structure. So for example.
Build file path: Main\MySolution.sln
Because in the TFS this is where the solution is. $/Projectname/Main/MySolution.sln. When I run the build step I get the error above. What am I doing wrong? The 42c94c0380966ffa folder is created on disc but it is empty.
LOG
[14:55:24]Checking for changes
[14:55:25]Publishing internal artifacts
[14:55:25][Publishing internal artifacts] Sending build.start.properties.gz file
[14:55:25]Clearing temporary directory: C:\TeamCity\buildAgent\temp\buildTmp
[14:55:25]Checkout directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Updating sources: server side checkout
[14:55:25][Updating sources] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[14:55:25][Updating sources] Transferring cached clean patch for VCS root: EEL TFS
[14:55:25][Updating sources] Repository sources transferred
[14:55:25][Updating sources] Removing C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25][Updating sources] Updating C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:25]Step 1/1: Build Solution (MSBuild) (2s)
[14:55:25][Step 1/1] Starting: C:\TeamCity\buildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:C:\TeamCity\buildAgent\work\42c94c0380966ffa /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[14:55:25][Step 1/1] in directory: C:\TeamCity\buildAgent\work\42c94c0380966ffa
[14:55:28][Step 1/1] Failed to start MSBuild.exe. Failed to find project file at path: C:\TeamCity\buildAgent\work\42c94c0380966ffa\Main\MySolution.sln
[14:55:28][Step 1/1] Process exited with code -42
[14:55:28][Step 1/1] Step Build Solution (MSBuild) failed
[14:55:28]Publishing internal artifacts
[14:55:28][Publishing internal artifacts] Sending build.finish.properties.gz file
[14:55:28]Build finished
My VCS root configuration, username and password removed.
And where the solution is located.
And the build step
Version control settings
General settings
It looks like you've configured your build to look for MySolution.sln but in TFS it's actually called EEL B2C.sln.

Categories

Resources