RegAsm : error RA0000 failed to load dll because it is not a valid .NET Assembly - regasm

I am facing a problem with installshield 2012 while registering the DLL using Regasm from exec task in MSBuild script. Its giving the below error:
[Step 6/10] RegAsm : error RA0000 : Failed to load 'E:\BuildAgent\work\2ae7096f1a3f5702\dev\bin\Obfusc-Contributor\orgname.ShellExtension.FileManager.dll' because it is not a valid .NET assembly
[05:45:33] [Step 6/10] RegAsm.exe failed. E:\BuildAgent\work\2ae7096f1a3f5702\dev\bin\Obfusc-Contributor\orgname.ShellExtension.FileManager.reg was not created for Component Colligo.ShellExtension.FileManager.dll1
[05:45:33] [Step 6/10] ISDEV : error -6210: An error occurred building COM .NET Interop information for Component orgname.ShellExtension.FileManager.dll1
This is happening on windows 10 . The same task is working fine on Windows 2008 machine

Related

Unknown command error in Jenkins when running Cake script using Powershell

Our Jenkins server has been successfully building projects for years using Powershell to run a cake script. Out of the blue today, we started getting the following error on multiple projects:
12:10:46 Running build script...
12:10:46
12:10:46 Error: Unknown command 'Default'.
12:10:46
12:10:46 .\scripts\build.cake -target=Default -configuration=Release
12:10:46 -verbosity=Verbose -environment=dev -certificatePath=C:/Program Files
12:10:46 (x86)/xxxxx/Verisign Certificate -certificateName=xxxxxxxx_cert.pfx
12:10:46 -certificatePassword=xxxxxxxxxxx
12:10:46 ^^^^^^^ No such command
12:10:46
12:10:47 Build step 'Windows PowerShell' marked build as failure
The build.ps1 script has not changed. The build.cake script has not changed. Jenkins was not updated since the last successful builds nor any of the add-ins.
If I remove "-target=Default" from the argument list, I just get the same error on "-configuration=Release" indicating unknown command: "Release".
Has anyone else experienced this?
The possible root cause of this failure is the cake version update (0.38.x --> 1.0)
You have two ways to fix this issue
Change the Argument Syntex - arguments should always be called with multi-dash syntax (e.g. --target=Foo) instead of (e.g. -target=Foo)
Refer: https://cakebuild.net/docs/getting-started/upgrade
Pinning the cake version
Specified the version of Cake in the tools/packages.config file
Refer: https://cakebuild.net/docs/writing-builds/reproducible-builds/pinning-cake-version

How to solution the following error when build EmulatorPkg ?

when I run build -p EmulatorPkg\EmulatorPkg.dsc -t VS2019 -a X64, it show the following error
LINK : warning LNK4108:ָ /ALIGN ûָ /DRIVERӳܲ
LINK : warning LNK4001: δָļʹÿ
LINK : warning LNK4068: δָ /MACHINEĬΪ X86
LINK : error LNK2001: ޷ⲿ _ModuleEntryPoint
d:\edk2\edk2\Build\EmulatorX64\DEBUG_VS2019\X64\WinHost.lib : fatal error LNK1120: 1 ޷ⲿ
NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\
MSVC\14.25.28610\bin\Hostx86\x64\link.exe": ش롰0x460
Stop.
Building ... d:\edk2\edk2\EmulatorPkg\BootModePei\BootModePei.inf [X64]
build.py...
: error 7000: Failed to execute command
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.25.28610\bin
\Hostx86\x86\nmake.exe /nologo tbuild [d:\edk2\edk2\Build\EmulatorX64\DEBUG_VS2019\X64\EmulatorPkg\Win
\Host\WinHost]
build.py...
: error F002: Failed to build module
d:\edk2\edk2\EmulatorPkg\Win\Host\WinHost.inf [X64, VS2019, DEBUG]
- Failed -
Build end time: 22:18:35, Apr.07 2020
Build total time: 00:00:13
but when build MdeModulePkg/MdeModulePkg.dsc, it not have any error.
The error was caused by missing support for VS2019 in this module.
Support was added upstream in commit 998d4c98b7c6 ("EmulatorPkg/WinHost: Add link flags for VS2019 tool chains.").

Cake Build- How to solve that "MSBUILD : error MSB1009: Project file does not exist."

I am using below Task and running this from VS Code.
Task("Build")
.Does(() =>
{
// Use MSBuild
MSBuild("E:/Repos/Code/TestService/TestWindowsService.sln", settings =>
settings.SetConfiguration(configuration));
});
But I am getting below error when I Was try to run this Script.
MSBUILD: error MSB1009: Project file does not exist.
Switch: E:/Repos/Code/Cake/Code/TestService/TestWindowsService.sln
An error occurred when executing task 'Build'.
Error: One or more errors occurred.
MSBuild: Process returned an error (exit code 1).

Allure plugin for VSTS returns error: Unknown Test Runner

The VSTS task: Generate Allure Report is failed.
The error is :
Unable to process command '##vso[results.publish type=Allure;mergeResults=true;publishRunAttachments=true;resultFiles=D:\a\1\s\allure-report\34;]' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
Unknown Test Runner.
Question: can it be a bug or problem connected to configs?
Configurations:
.Net version: 4.6.1, Nunit3, Nunit3 allure adapter
Task to run tests is a Command Line task where I used nunit3-console.exe to run test.
Configurations for Allure plugin:
Results directory : allure-results
Target directory : allure-report/$(Build.BuildNumber)
The output logs:
****************************************************************************** Starting: Generate Allure Report
============================================================================== Task : Generate Allure Report Description : Generates Allure
report based on the test results Version : 1.0.0 Author :
Molecula Help : More
Information
============================================================================== C:\Program Files\nodejs\node.exe
D:\a_tasks\AllureGenerate_5c975f9d-1c3a-469f-b7c2-8907bf3eacfb\1.0.0\node_modules\allure-commandline\bin\allure
generate --output D:\a\1\s\allure-report\34 D:\a\1\s\allure-results
Command aborted due to exception {}.
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1 (Exit value: 1) at
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at
ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at
ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46)
org.apache.commons.exec.ExecuteException: Process exited with an
error: 1 (Exit value: 1) at
org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at
org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:153)
at
ru.yandex.qatools.allure.command.ReportGenerate.runUnsafe(ReportGenerate.java:48)
at
ru.yandex.qatools.allure.command.AbstractCommand.run(AbstractCommand.java:52)
at ru.yandex.qatools.allure.CommandLine.main(CommandLine.java:46) at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Exception in thread "main"
ru.yandex.qatools.allure.data.ReportGenerationException: Could not
find any allure results at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:58)
at
ru.yandex.qatools.allure.data.AllureReportGenerator.generate(AllureReportGenerator.java:53)
at ru.yandex.qatools.allure.AllureMain.main(AllureMain.java:48)
Unable to process command '##vso[results.publish
type=Allure;mergeResults=true;publishRunAttachments=true;resultFiles=D:\a\1\s\allure-report\34;]'
successfully. Please reference documentation
(http://go.microsoft.com/fwlink/?LinkId=817296) Unknown Test Runner.
The default setting directory "allure-results" in the Allure task usually does not point to the actual path to result directory correctly since the path is different in different projects and environment. You need to update the setting to configure it to the actual path to the result directory manually.
According to the information you provided, the path to the result could be like this:
$(Build.SourcesDirectory)\SolutionFolder\ProjectFolder\bin\$(BuildConfiguration)\allure-results

WindowsAzure Assembly not found while downloading Hive output on HDInsight

The following script runs a hive job from my local machine running Windows 8.1 and copies the output to a local file. It has been working fine up to now, but after upgrading to Windows 10 it is erroring out when I call Get-AzureHDInsightJobOutput. I have tried uninstalling Windows Azure Powershell, and reinstalling, but that did not help. Not sure how to proceed now, anyone have any ideas?
# Retrieve a single tagged stream from project hive database into a single file
#
#
param(
[string]$table = 'sensor_part',
[string]$bld = 'B24',
[string]$tag = 'B24/AHU/LR/_1/OAT'
)
$clusterName = 'Crunch88'
$HiveQuery = "select * from ${table} where bld='${bld}' and tag='${tag}'"
$jobDefinition = New-AzureHDInsightHiveJobDefinition -Query $HiveQuery -StatusFolder '/tagtransfer'
$job = Start-AzureHDInsightJob -Cluster $clusterName -JobDefinition $jobDefinition
Write-Host "Wait for the Hive job to complete ..." -ForegroundColor Green
Wait-AzureHDInsightJob -Job $job -WaitTimeoutInSeconds 72000
Get-AzureHDInsightJobOutput -StandardError -JobId $job.JobId -Cluster $clusterName
Write-Host "Copy the standard output to a local file" -ForegroundColor Green
Get-AzureHDInsightJobOutput -Cluster $clusterName -JobId $job.JobId -DownloadTaskLogs -TaskLogsDirectory "tasklogs"
# AzCopy /Y /Source:${blobcontainer} /Dest:${tsvpath} /SourceKey:${blobkey} /Pattern:${dirout}/stdout
Here is the results of a run with the error message:
PS C:\Windows\System32\WindowsPowerShell\v1.0> F:\88acres\3-hive\hiveretrieval\error.ps1
WARNING: When submitting a query use the -RunAsFile switch to prevent errors with query lengths or special characters
Wait for the Hive job to complete ...
Cluster : Crunch88
ExitCode : 0
Name : Hive: select * from sensor
PercentComplete : map 100% reduce 0%
Query : select * from sensor_part where bld='B24' and tag='B24/AHU/LR/_1/OAT'
State : Completed
StatusDirectory : /tagtransfer
SubmissionTime : 30-Aug-15 12:26:18
JobId : job_1438448805059_0015
Get-AzureHDInsightJobOutput : Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At F:\88acres\3-hive\hiveretrieval\error.ps1:18 char:1
+ Get-AzureHDInsightJobOutput -StandardError -JobId $job.JobId -Cluster ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureHDInsightJobOutput], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.GetAzu
reHDInsightJobOutputCmdlet
Copy the standard output to a local file
Get-AzureHDInsightJobOutput : Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At F:\88acres\3-hive\hiveretrieval\error.ps1:21 char:1
+ Get-AzureHDInsightJobOutput -Cluster $clusterName -JobId $job.JobId - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureHDInsightJobOutput], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.GetAzu
reHDInsightJobOutputCmdlet
Update:
I have enabled fusion logging. The results indicate that it is binding to 5.0.0.0 instead of 3.0.3.0. Not sure how to fix this.
Failed log entry for 3.0.3.0 follows:
*** Assembly Binder Log Entry (04-Sep-15 # 08:54:11) ***
The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Windows/System32/WindowsPowerShell/v1.0/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = powershell_ise.exe
Calling assembly : Microsoft.Hadoop.Client, Version=1.5.9.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft SDKs/Azure/PowerShell/ServiceManagement/Azure/HDInsight/Microsoft.WindowsAzure.Storage.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\HDInsight\Microsoft.WindowsAzure.Storage.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.WindowsAzure.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
WRN: Comparing the assembly name resulted in the mismatch: Major Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft SDKs/Azure/PowerShell/ServiceManagement/Azure/HDInsight/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft SDKs/Azure/PowerShell/ServiceManagement/Azure/HDInsight/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft SDKs/Azure/PowerShell/ServiceManagement/Azure/HDInsight/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: All probing URLs attempted and failed.
***
Assembly Binder Log Entry (04-Sep-15 # 08:54:11) ***
And here is the successful version for 5.0.0.0:
*** Assembly Binder Log Entry (04-Sep-15 # 08:54:10) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.WindowsAzure.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Windows/System32/WindowsPowerShell/v1.0/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = powershell_ise.exe
Calling assembly : Microsoft.WindowsAzure.Commands.Sync, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Using application configuration file: C:\Windows\System32\WindowsPowerShell\v1.0\powershell_ise.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.WindowsAzure.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.DLL.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Windows/System32/WindowsPowerShell/v1.0/Microsoft.WindowsAzure.Storage/Microsoft.WindowsAzure.Storage.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft SDKs/Azure/PowerShell/ServiceManagement/Azure/Compute/Microsoft.WindowsAzure.Storage.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Compute\Microsoft.WindowsAzure.Storage.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Microsoft.WindowsAzure.Storage, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Where-ref bind Codebase does not match what is found in default context. Keep the result in LoadFrom context.
LOG: Binding succeeds. Returns assembly from C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Compute\Microsoft.WindowsAzure.Storage.dll.
LOG: Assembly is loaded in LoadFrom load context.
Update: Added the required assembly using a Nuget package. Still didn't help. Think I somehow need to tell Nuget to make it available for the PowerShellISE, but don't see a parameter for that... This must be close to a solution.
PS C:\WINDOWS\system32> nuget install WindowsAzure.Storage -version 3.0.3
Attempting to resolve dependency 'Microsoft.Data.OData (ò 5.6.0)'.
Attempting to resolve dependency 'System.Spatial (= 5.6.0)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.6.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (ò 5.0.6)'.
Attempting to resolve dependency 'Microsoft.Data.Services.Client (ò 5.6.0)'.
Attempting to resolve dependency 'Microsoft.WindowsAzure.ConfigurationManager (ò 1.8.0.0)'.
Installing 'System.Spatial 5.6.0'.
Successfully installed 'System.Spatial 5.6.0'.
Installing 'Microsoft.Data.Edm 5.6.0'.
Successfully installed 'Microsoft.Data.Edm 5.6.0'.
Installing 'Microsoft.Data.OData 5.6.0'.
Successfully installed 'Microsoft.Data.OData 5.6.0'.
Installing 'Newtonsoft.Json 5.0.6'.
Successfully installed 'Newtonsoft.Json 5.0.6'.
Installing 'Microsoft.Data.Services.Client 5.6.0'.
Successfully installed 'Microsoft.Data.Services.Client 5.6.0'.
Installing 'Microsoft.WindowsAzure.ConfigurationManager 1.8.0.0'.
Successfully installed 'Microsoft.WindowsAzure.ConfigurationManager 1.8.0.0'.
Installing 'WindowsAzure.Storage 3.0.3.0'.
Successfully installed 'WindowsAzure.Storage 3.0.3.0'.
PS C:\WINDOWS\system32> F:\88acres\3-hive\hiveretrieval\error.ps1
WARNING: When submitting a query use the -RunAsFile switch to prevent errors with query lengths or special characters
Wait for the Hive job to complete ...
Cluster : Crunch88
ExitCode : 0
Name : Hive: select * from sensor
PercentComplete : map 100% reduce 0%
Query : select * from sensor_part where bld='B24' and tag='B24/AHU/LR/_1/OAT'
State : Completed
StatusDirectory : /tagtransfer
SubmissionTime : 04-Sep-15 08:03:50
JobId : job_1440975278889_0021
Get-AzureHDInsightJobOutput : Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
At F:\88acres\3-hive\hiveretrieval\error.ps1:18 char:1
+ Get-AzureHDInsightJobOutput -StandardError -JobId $job.JobId -Cluster ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AzureHDInsightJobOutput], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.PSCmdlets.GetAzu
reHDInsightJobOutputCmdlet
I didn't find a good solution for this issue. I ran into this same issue after I installed to Visual Studio 2015, so if someone has a good solution I'd love to hear it. At this point in time... I just took the Microsoft.WindowsAzure.Storage.dll version 3.0.3.0 and copied it to my \Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\HDInsight folder (making a backup of the newer version first). It works fine now, but this is only a temporary work around.