MSBuild error MSB4018: The "ResolveKeySource" task failed unexpectedly - msbuild

It has always been a clean build process till today. Checked in some source files, ran Hudson and I get these additional compiler errors:
[exec] (ResolveKeySource target) ->
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: The "ResolveKeySource" task failed unexpectedly.
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: at System.Windows.Forms.Form.ShowDialog()
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: at Microsoft.Build.Tasks.ResolveKeySource.ResolveManifestKey()
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: at Microsoft.Build.Tasks.ResolveKeySource.Execute()
[exec] C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1805,7): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
It does not seem to affect output as I can deploy assemblies without incident. However, I need to restore sanitary state of build output. Any ideas what could have possibly changed? This is with Visual Studio 2008 and .NET 3.5.
TIA.

Your build process is trying to prompt you for a password, possibly for a certificate or .pfx that is being used to sign your assemblies.
Since Hudson is running as a system service, it is now allowed to interact with the desktop and display a modal dialog.
To resolve this, configure Hudson to run as a user account (under the Services configuration) and install the certificate into the Local Store for that account.

Related

SSIS cannot load script for execution when click on edit script and build

For some reason my SSIS script task in control flow and SSIS script component in data flow not working. If I drop an empty script and click on start it executes. But if I click on edit script and write simple code like
int a=10;
and click on build build is succeeded but when I click on start fails the package execution.
I tried with SSDT with visual studio 2017 and SSIS with Visual Studio 2019
with cannot load the script message as below for script task.
For script component in data flow task it throws the below error:-
System.IO.FileLoadException: Could not load file or assembly '15872 bytes loaded from Microsoft.SqlServer.TxScript, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Exception from HRESULT: 0xD0000003
File name: '15872 bytes loaded from Microsoft.SqlServer.TxScript, Version=15.100.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' ---> System.Runtime.InteropServices.COMException (0xD0000003): Exception from HRESULT: 0xD0000003
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, Boolean fSkipIntegrityCheck, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly)
at Microsoft.SqlServer.Dts.Pipeline.VSTAComponentScriptingEngine.GetScriptEntryPoint(String versionGuid)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.CreateUserScriptInstance()
There is an issue in Visual studio that caused the error. Here is the latest fix posted by Microsoft on there website https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects&ssr=false#overview
enter image description here

FXCop assembly load failure

Command line:
"C:\Program Files (x86)\Microsoft Fxcop 10.0\FxCopCmd.exe" /file:XXX.exe /out:fxcop-report.xml /outxsl:none /forceoutput /searchgac /assemblyCompareMode:StrongNameIgnoringVersion /verbose
Error from report:
<Type>Microsoft.FxCop.Common.AssemblyLoadException</Type>
<ExceptionMessage>Could not load XXX.</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.InvalidMetadataException</InnerType>
<InnerExceptionMessage>The following error was encountered while reading module 'XXX': Security attribute type does not have a default constructor: System.Security.Permissions.SecurityPermission.</InnerExceptionMessage>
Anyone any ideas?

Merged DLL with ILMerge is working under clr4 but under clr2

I am running ILMerge with the following parameters:
Executing 'C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe'
[exec] '/keyfile:C:\myKey.snk'
[exec] '/target:library'
[exec] '/targetplatform:v2,C:\Windows\Microsoft.NET\Framework\v2.0.50727'
[exec] '/copyattrs'
[exec] '/lib:C:\Windows\Microsoft.NET\Framework\v2.0.50727'
[exec] '/log:log.txt'
[exec] '/out:C:\mergedDll.dll'
[exec] 'mydll1.dll'
[exec] 'mydll2.dll'
The reproduced dll appears to work with CLR4 but not with CLR2. When I am testing the dll with Corflags, I get the following output:
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 9
ILONLY : 1
32BIT : 0
Signed : 1
The error I get with CLR2 is:
error BC30009: Reference required to assembly 'mergedDll, Version=1.2.3.123, Culture=neutral, PublicKeyToken=1234dbf1234567b' containing the implemented interface 'com.mycompany.myapplication.MyInterface'. Add one to your project.
The interface mentioned above is written in J#.
How can I make the merged dll work under CLR2?
Thanks!

Wix light.exe : error LGHT0001: The system cannot open the device or file specified.

Today we build our product with MSBuild /m to build with multiprocess.
Before we do a change to heat some files in pre-build event, build with MSBuild multiprocess can be success.
Now build is failed with following exception:
124>light.exe : error LGHT0001: The system cannot open the device or file specified. (Exception from HRESULT: 0x8007006E) [...MSI.wixproj]
Exception Type: System.IO.FileLoadException
Stack Trace:
at Microsoft.Tools.WindowsInstallerXml.MergeMod.IMsmMerge2.OpenModule(String fileName, Int16 language)
at Microsoft.Tools.WindowsInstallerXml.Binder.MergeModules(String tempDatabaseFile, Output output, FileRowCollection fileRows, StringCollection suppressedTableNames)
at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
(Link target) ->
light.exe : error LGHT0001: The system cannot open the device or file specified. (Exception from HRESULT: 0x8007006E) [...Msi.wixproj]
using Wix 3.8
After investigation with team, we find out root cause.
ProductMSI.sln has more than 50 MSI wix projects and all shared MSM projects to build.
Each MSI project has a post build event action that it will reopen MSI related MSM to do some change to MSI by WindowsInstaller API as DataBase. And it opens MSM as read&edit mode by API.
So if one shared MSM is opened by one MSI post event and will be opened by another wix project to compile. Open request will be denied. The above error will be thrown.
Solution:
1.Change post event action to open MSM as read-only, instead of read&edit mode.
We test it pass.

Appbase being set to nothing at runtime

I have a difficult to reproduce error on about three user installs out of 20. This is a .net Windows application, 2005 in VB.Net running on XP. After opening up a window, we get an error:
Could not load file or assembly 'Infragistics2.Win.UltraWinChart.v8.2,
Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its
dependencies. Element not found. (Exception from HRESULT: 0x80070490) *****ClearTrac *****
at ClearTrac.ucNav.InitializeComponent()
at ClearTrac.ucNav..ctor()
at ClearTrac.frmPortfolio.InitializeComponent() ...
This happens also for the ReportViewer dll and a couple other infragistics dll's.
I turned on Bind Logging, and the first binds are ok, but when I get the error, the Appbase has been set to blank:
*** Assembly Binder Log Entry (2/20/2009 # 3:41:10 PM) ***
The operation failed.
Bind result: hr = 0x80070490. Element not found.
Assembly manager loaded from: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and Settings\rdelaney\Local Settings\Apps\2.0\ZZ09GJK6.2VY\GPRTP6CM.GOX\clea..tion_8055aae51715540e_0001.0004_0a540274bbdc609c\ClearTrac.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = CAM\rdelaney
LOG: DisplayName = Microsoft.ReportViewer.WinForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase =
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ClearTrac.exe`
Calling assembly : ClearTrac, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\rdelaney\Local Settings\Apps\2.0\ZZ09GJK6.2VY\GPRTP6CM.GOX\clea..tion_8055aae51715540e_0001.0004_0a540274bbdc609c\ClearTrac.exe.config
LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070490).
Any ideas?
You should check that on problematic computers the Microsoft.ReportViewer.WinForms is either in GAC or in application directory.
If it's not, you should install Microsoft Report Viewer redistributable on problematiuc computers.
http://www.microsoft.com/downloads/details.aspx?FamilyID=cc96c246-61e5-4d9e-bb5f-416d75a1b9ef&displaylang=en
We found this error only happens under the .net Framework with SP1 or SP2 installed. With the bare .net framework 2.0 installed, it does not happen.