Unable to run a basic Sonar analysis from MSBuild.SonarQube.Runner - sonar-runner

I am sure I am missing something but unable to figure out what.
The following commands are executed via the VS2015 command prompt.
D:\Sonar\Project1\msbuild\MSBuild.SonarQube.Runner.exe begin /k:"FC" /n:"FC" /v:"1.0"
msbuild.exe D:\Sonar\Project1\FC.sln
D:\Sonar\Project1\msbuild\MSBuild.SonarQube.Runner.exe end
The sonar-project.properties file that gets automatically created in the out directory under .sonarqube folder shows the following
E0566501-CF6F-454A-88CA-6AEFEA7D0EBC.sonar.projectKey=FC:E0566501-CF6F-454A-88CA-6AEFEA7D0EBC
E0566501-CF6F-454A-88CA-6AEFEA7D0EBC.sonar.projectName=FC
E0566501-CF6F-454A-88CA-6AEFEA7D0EBC.sonar.projectBaseDir=D:\\Sonar\\Project1\\FC
E0566501-CF6F-454A-88CA-6AEFEA7D0EBC.sonar.sources=\
D:\\Sonar\\Project1\\FileComparison\\Form1.cs,\
.
.
E0566501-CF6F-454A-88CA-6AEFEA7D0EBC.sonar.stylecop.projectFilePath=D:\\Sonar\\Project1\\FC\\FC.csproj
sonar.host.url=http://localhost:9000
sonar.sourceEncoding=UTF-8
sonar.visualstudio.enable=false
sonar.projectKey=FC
sonar.projectName=FC
sonar.projectVersion=1.0
sonar.projectBaseDir=D:\\Sonar\\Project1\\FC
sonar.working.directory=C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\.sonarqube\\out\\.sonar
# FIXME: Encoding is hardcoded
sonar.sourceEncoding=UTF-8
sonar.modules=E0566501-CF6F-454A-88CA-6AEFEA7D0EBC
Screenshot of console

Related

SWUpdate on RPi4 via yocto - error parsing configuration file

After booting SWUpdate yocto-generated image for the first time, executing swupdate results in error message:
Error parsing configuration file: 'globals' section missing, exiting.
I tried to strictly follow SWUpdate's documentation, but it gets short when it comes to yocto integration. I'm using meta-swupdate, meta-swupdate-boards, and meta-openembedded layers together with poky example repository all at Kirkstone tag, building via bitbake update-image and having modyfied local.conf as:
MACHINE ??= "raspberrypi4-64"
ENABLE_UART = "1"
RPI_USE_U_BOOT = "1"
IMAGE_FSTYPES = "wic ext4.gz"
PREFERRED_PROVIDER_u-boot-fw-utils = "libubootenv"
IMAGE_INSTALL:append = " swupdate"
Is there anything else I need to modify to generate the configuration file and be able to run SWUpdate binary properly?
Side question: In the documentation, it's recommended to append swupdate-www to achieve a better web server. However, if I append it, there is no swupdate-www binary inside the `/usr/bin' directory.
As with other recipes folders the recipes-support/swupdate/swupdate/raspberrypi4-64 folder was missing inside the meta-swupdate-boards layer. Therefore, an empty config file was always generated. After adding this folder and all related files, strongly inspired by raspberrypi3 folder, the error was gone and swupdate -h provided the expected output.
There was also one new error during build process thrown by yocto. It was related to missing systemd requirement and was solved by adding:
DISTRO_FEATURES_append = " systemd"
to local.conf

Visual Studio Hangs After Adding Post-Build-Event

I am following this tutorial which explains how to attached post-build events to a project.
This is my .bat file (tried with and without the D: remd out):
CMD
ECHO parameter=%1
CD %1
rem D:
COPY WpfFileDeleter.exe temp.exe
"..\..\ILMerge.exe" /out:"WpfFileDeleter.exe" "temp.exe" "Microsoft.WindowsAPICodePack.dll" "Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll" "Microsoft.WindowsAPICodePack.Sensors.dll" "Microsoft.WindowsAPICodePack.Shell.dll" "Microsoft.WindowsAPICodePack.ShellExtensions.dll"
DEL temp.exe
And I also added this ILMerge.exe.config as per the tutorial (I was getting the Unresolved assembly reference not allowed error):
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
</startup>
</configuration>
But when I build my project in VS it just hangs with this message in Output:
1>------ Rebuild All started: Project: WpfFileDeleter, Configuration: Debug Any CPU ------
I can see that some files have been copied to bin/debug, such as the .dlls I specified and temp.exe, but any WpfFileDeleter.exes cannot be run properly as it has not been merged properly.
My question is How can I debug this issue? Is there some way of outputting the results of ILMerge or the build process so that I can see where it is going wrong?
I was able to resolve this by specifying the targetFramework when calling ILMerge in the batch file:
"..\..\ILMerge.exe" /out:"WpfFileDeleter.exe" /targetPlatform:"v4" "temp.exe" "Microsoft.WindowsAPICodePack.dll" "Microsoft.WindowsAPICodePack.ExtendedLinguisticServices.dll" "Microsoft.WindowsAPICodePack.Sensors.dll" "Microsoft.WindowsAPICodePack.Shell.dll" "Microsoft.WindowsAPICodePack.ShellExtensions.dll"

error MSB3073: The command "staticdv.exe /devenv /check" exited with code -1

I have a NDIS 6 filter driver. It is a packet capture driver based on the official ndislwf example. The whole project is open sourced on this GitHub repo. npf.sln can be opened via Visual Studio 2015.
My problem is the Static Driver Verifier (SDV) doesn't work on my project. When I clicked Driver -> Launch Static Driver Verifier... on Visual Studio 2015, it popped up the SDV GUI, then I clicked Clean and Start. After a while (3-5 minutes), a window popped up saying SDV encountered an error of unknown origin.. And the Alerts tab of the SDV UI said:
J:\npcap\packetWin7\npf\npf>cd /d "J:\npcap\packetWin7\npf\npf" && msbuild "npf.vcxproj" /t:sdv /p:inputs="/devenv /check" /p:configuration="Win7 Release SDV" /p:platform="x64"
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 7/25/2016 12:42:39 PM.
Project "J:\npcap\packetWin7\npf\npf\npf.vcxproj" on node 1 (sdv target(s)).
sdv:
staticdv.exe /devenv /check
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 4.0.505.8
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for <Win7 Release SDV|x64>
Build 'npf' ... Done
Scan 'npf' ... Done
No reuse data to copy from previous SDV run.
The finalization step failed for 'npf' .
C:\Program Files (x86)\Windows Kits\10\build\windowsdriver.Sdv.targets(65,9): error MSB3073: The command "staticdv.exe /devenv /check" exited with code -1. [J:\npcap\packetWin7\npf\npf\npf.vcxproj]
Done Building Project "J:\npcap\packetWin7\npf\npf\npf.vcxproj" (sdv target(s)) -- FAILED.
Build FAILED.
"J:\npcap\packetWin7\npf\npf\npf.vcxproj" (sdv target) (1) ->
(sdv target) ->
C:\Program Files (x86)\Windows Kits\10\build\windowsdriver.Sdv.targets(65,9): error MSB3073: The command "staticdv.exe /devenv /check" exited with code -1. [J:\npcap\packetWin7\npf\npf\npf.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:01:30.61
Then I looked at the StaticDVTrace.log log. It said as below:
Information:Calling DriverCleanup.
Information:Creating a new SDV object.
Information:Loading cache data.
Information:Calling cleanup routine.
Information:Creating a new SDV object.
Information:SetBase this.DdkPath=C:\Program Files (x86)\Windows Kits\10\
Information:SetBase this.Path=J:\npcap\packetWin7\npf\npf
Information:SetBase creating the DriverCollection via constructor.
Information:Driver Constructor:Calling RuleCollection constructor with rule list and rule path
Information:SetBase this.Environment=WDK
Information:SetBase Calling InitBaseEnvironment.
Information:Check that we have driver folder.
Information:Calling build to get cl and link flags.
Information:GenerateBuildLogNewCall build.exe.
Information:GenerateBuildLogNewCall to build.exe worked.
Information:Build 'npf' ... Done
Information:Found Sdv links file and attempting to serialize the data into our object model.
Information:Found Sdv source file and attempting to serialize the data into our object model.
Information:Found cflags in Sdv source file.
Information:Slam model equals
Information:Slam rules equals
Information:Slam Data equals
Information:Calling OpenNewConfiguration
Information:SetBase this.DdkPath=C:\Program Files (x86)\Windows Kits\10\
Information:SetBase this.Path=J:\npcap\packetWin7\npf\npf
Information:SetBase Opening All.sdv to load active rule list.
Information:OpenMsft Opening All.sdv from:C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\data\ndis\All.sdv
Information:OpenMsft Reading :C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\data\ndis\All.sdv
Information:OpenMsft Adding :DDIUSAGE.SDV.fsm to the list of rules.
Information:OpenMsft Adding :IRQL.SDV.fsm to the list of rules.
Information:OpenMsft Adding :IRQL_SHARED.SDV.fsm to the list of rules.
Information:OpenMsft Adding :LOCKING.SDV.fsm to the list of rules.
Information:OpenMsft Adding :MEMORYUSAGE.SDV.fsm to the list of rules.
Information:OpenMsft Adding :MISCELLANEOUS.SDV.fsm to the list of rules.
Information:OpenMsft Adding :OIDPROCESSING.SDV.fsm to the list of rules.
Information:OpenMsft Adding :WARNING.SDV.fsm to the list of rules.
Information:OpenMsft Adding :.fsm to the list of rules.
Information:SetBase Calling driver constructor.
Information:RuleCollection Constructor:Calling Rule Constructor.
Information:RuleCollection Constructor:add rule object to collection.
...
Information:RuleCollection Constructor:Calling Rule Constructor.
Information:RuleCollection Constructor:add rule object to collection.
Information:SetBase this.Environment=WDK
Information:SetBase Calling InitBaseEnvironment.
Information:this.NumberOfChecks=0100
Information:this.NumberOfNotStarted=100
Information:Opening sdv-default.xml from:C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\data\ndis
Information:SdvScan:Local sdv-default.xml found.
Information:Calling build to get cl and link flags.
Information:Loading library data from cache at:C:\Program Files (x86)\Windows Kits\10\
Information:Loading build data.
Information:Counting the LOC in the driver.
Information:Loading WDM entry points from :C:\Program Files (x86)\Windows Kits\10\TOOLS\SDV\data\ndis\DdkEntryPoints.xml
Information:Calling CheckScan to validate we have a valid SDV-map.h file.
Information:CheckScan:Generating SDV-map.h file via call to SdvMap.
Information:SdvMap:Iterate over each driver in the collection.
Information:BuildLib:Create sdv folder.
Information:BuildLib:Create sdv\scan folder.
7/25/2016 11:00:08 PM:The SDV-map.h file at: J:\npcap\packetWin7\npf\npf.
Information:The SDV-map.h file at:J:\npcap\packetWin7\npf\npf does not have the "Approved" flag set to "true."
Information:Scan 'npf' ... Done
Information:CheckScan:Calling LoadSdvMap.
Information:Check if debug flags are set.
Information:Start sdv scan step via call to SdvScan.
Information:SdvScan:Calling SetupSdvScanFolders
Information:SdvScan:Checking if we have a local version of sdv-default.xml
Information:BuildLib:Create sdv folder.
Information:BuildLib:Create sdv\scan folder.
Information:Copying old reuse data for this run...J:\npcap\packetWin7\npf\npf
Information:No reuse data to copy from previous SDV run.
Information:Calling the SdvCheck stage.
Information:SdvCheck:Calling CleanupCflags.
Information:SdvCheck:Calling SetupSdvCheckFolders.
Information:SdvCheck:Calling RuleSpec.
Information:RuleSpec:.
Information:RuleSpec:Calling CompileStage for
Information:RuleSpec:Calling CompileStage for pre_isminiport.fsm
7/25/2016 11:00:16 PM:The SDV compile step failed.
I can't tell anything from the error message. Can anybody help me? Thanks!
You need to approve the sdv-map.h file. Open the sdv-map.h file that SDV generated in your source directory, verify that everything looks correct, then change //Approved=false to //Approved=true.

Automatically log error and terminate application with SmartAssembly

I'm using SmartAssembly for both general code obfuscation as well as error reporting in an application.
If my application encounters an unhandled exception, I'd like the exception to be logged and then terminate the application without any user interaction. Is it possible to create a SmartAssembly project that allows this?
I've tried setting up the project in the SmartAssembly GUI, as well as on the command-line with no luck. Below is the command and arguments I've tried, but so far I can't determine how to get it to both terminate the app and log the error with no user input.
Create SA Project:
"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com"
/create shell.saproj input=C:\Repositories\MyApp\src\shell.exe
/output=shell.exe
/reportappname="MyTestApp"
/errorreportingtemplate=standard;continueonerror=false,email:"my#email.com"
/reportprojectname="Shell"
/reportcompanyname="My Company"
Build the project:
"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" /build shell.saproj
SmartAssembly includes a few examples of custom ErrorReportingTemplates,
located in Red Gate/SmartAssembly 6/SDK/Exception Reporting/
The examples are lumped into a few categories:
Without UI
Standard
Custom UI
Via Email
Secured Proxy
Silverlight
Silverlight Basic
In each of these folders, there is a .csproj file that one can extend to get their desired results.
Inside the Without UI folder is the project we're after, titled Sample 01 - Without User Interface.csproj
If you're just after a .dll to use and don't care about a re-usable solution, edit this file directly and use the resulting .dll file (the alternative being to create a new project, and pull in the reference to SmartAssembly.SmartExceptionsCore).
Edit the OnReportException function to look like the following:
protected override void OnReportException(ReportExceptionEventArgs e)
{
for (int i=0; i<3; i++)
{
if (e.SendReport()) break;
}
e.TryToContinue = false;
System.Diagnostics.Process proc = System.Diagnostics.Process.GetCurrentProcess();
proc.Kill();
}
Here's a Gist of the final result, if you're confused.
Create the project file with the GUI or via cmd:
"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com"
/create shell.saproj input=C:\Repositories\MyApp\src\shell.exe
/output=shell.exe
/reportappname="MyTestApp"
/errorreportingtemplate=MySmartAssemblyLogger.dll;continueonerror=false,email:"my#email.com"
/reportprojectname="Shell"
/reportcompanyname="My Company"
Build with the GUI or via cmd:
"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" /build shell.saproj
According to the example on the website http://www.red-gate.com/supportcenter/Content/SmartAssembly/help/6.7/SA_UsingTheCommandLine
You should replace "standard" with "auto" and that is supposed to send the error report without the user dialog appearing.

Cocos2d-x cannot run build-win32.bat on Windows 7 64 bit

I'm new in cocos2d-x. I started setting up environment for developing.
I download the cocos2d-x-2.1.5 zip file and extracted. Then I double click on build-win32.bat, these line apppeared :
Build started 8/28/2013 9:08:01 AM.
0>D:\Dev_cocos2dx\cocos2d-x-2.1.5\cocos2d-win32.vc2012.sln : Solution file error MSB5009: Erro
r parsing the nested project section in solution file.
Build FAILED.
D:\Dev_cocos2dx\cocos2d-x-2.1.5\cocos2d-win32.vc2012.sln : Solution file error MSB5009: Er
ror parsing the nested project section in solution file.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.01
Microsoft (R) Build Engine version 4.0.30319.17929
[Microsoft .NET Framework, version 4.0.30319.18052]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 8/28/2013 9:08:01 AM.
0>D:\Dev_cocos2dx\cocos2d-x-2.1.5\cocos2d-win32.vc2012.sln : Solution file error MSB5009: Erro
r parsing the nested project section in solution file.
Build FAILED.
D:\Dev_cocos2dx\cocos2d-x-2.1.5\cocos2d-win32.vc2012.sln : Solution file error MSB5009: Er
ror parsing the nested project section in solution file.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.01
/*
* Check the cocos2d-win32 application "TestCpp.exe" ...
*/
The system cannot find the path specified.
/*
* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide.
*/
File not found - Resources
0 File(s) copied
File not found - Resources
0 File(s) copied
File not found - Resources
0 File(s) copied
File not found - Resources
0 File(s) copied
File not found - Resources
0 File(s) copied
File not found - js
0 File(s) copied
File not found - tests
0 File(s) copied
File not found - MoonWarriors
0 File(s) copied
File not found - WatermelonWithMe
0 File(s) copied
File not found - Published files iOS
0 File(s) copied
Can't find the binary "TestCpp.exe", is there build error?
Press any key to continue . . .
I'm using windows 7 64bit .
Thanks!
I found a solution:
1.Open the "cocos2d-win32.vc2010.sln".
2.Create a new project.
3.Delete the project of step 2.
4.Close .sln file, click save.
After these steps, my batch file works well. Hope it is useful for you.

Resources