TFS 2010 - TF215097 .Cannot create unknown type '{clr-namespace: - namespaces

On TFS 2010, I have this mistake when I launch my Build Definition containing my custom activity:
TF215097: An error occurred while initializing a build for build definition \BCA3\BuildProcessSourcet8: Cannot create unknown type '{clr-namespace:BuildProcessSourcet8.Activities;assembly=Sourcet8}CopyActivity'.
Part of XAML file:
<Activity mc:Ignorable="sads sap sap2010" x:Class="TfsBuild.Process" this:Process.AutomatedTests="[{ New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""AssemblyFileSpec"": ""**\\*test*.dll;**\\*test*.appx"", ""RunSettingsFileName"": null, ""TestCaseFilter"": """", ""RunSettingsForTestRun"": { ""ServerRunSettingsFile"": """", ""TypeRunSettings"": ""Default"", ""HasRunSettingsFile"": false }, ""HasRunSettingsFile"": false, ""HasTestCaseFilter"": false, ""ExecutionPlatform"": ""X86"", ""FailBuildOnFailure"": false, ""RunName"": """" } ") }]" this:Process.AdvancedTestSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""AnalyzeTestImpact"": false, ""DisableTests"": false, ""PreActionScriptPath"": """", ""PreActionScriptArguments"": """", ""PostActionScriptPath"": """", ""PostActionScriptArguments"": """" } ")]" this:Process.BuildNumberFormat="["$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)"]" this:Process.CleanWorkspace="[True]" this:Process.CreateLabel="[True]" this:Process.AdvancedBuildSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""MSBuildArguments"": """", ""MSBuildPlatform"": ""Auto"", ""PreActionScriptPath"": """", ""PreActionScriptArguments"": """", ""PostActionScriptPath"": """", ""PostActionScriptArguments"": """", ""RunCodeAnalysis"": ""AsConfigured"" } ")]" this:Process.AgentSettings="[New Microsoft.TeamFoundation.Build.Common.BuildParameter(" { ""MaxExecutionTime"": ""00:00:00"", ""MaxWaitTime"": ""04:00:00"", ""Name"": ""*"", ""Tags"": [], ""TagComparison"": ""MatchExactly"" } ")]" this:Process.CleanBuild="[True]" this:Process.OutputLocation="["SingleFolder"]" this:Process.CreateWorkItem="[True]" this:Process.UpdateAssociatedWorkItems="[True]" this:Process.SupportedReasons="All" this:Process.BuildProcessVersion="12.0"
xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"
xmlns:local="clr-namespace:BuildProcessSourcet8;assembly=Sourcet8"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mtba="clr-namespace:Microsoft.TeamFoundation.Build.Activities;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbac="clr-namespace:Microsoft.TeamFoundation.Build.Activities.Core;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbat="clr-namespace:Microsoft.TeamFoundation.Build.Activities.TeamFoundation;assembly=Microsoft.TeamFoundation.Build.Activities"
xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common"
xmlns:mtbc1="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client"
xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mtbwt="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Tracking;assembly=Microsoft.TeamFoundation.Build.Workflow"
xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"
xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"
xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation"
xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"
xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib"
xmlns:this="clr-namespace:TfsBuild"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
My Build controller is correct

The solution seems to put the custom activity DLL in the GAC.

I solved the issue by installing same version of VisualStudio and TFS client in the build machine. For example Install VS 2013 and TFS 2013 and also make sure you build the custom dll also using the VS 2013 .

Related

How to print an html file as a report after a successful build, in Jenkins?

My current Jenkins Version: Jenkins 2.204.4
I have a python program generating an HTML Report(only contains a table).
I need to print this as the build report after a successful Jenkins pipeline build.
I tried using the dashboard plugin(iframe portlet) and htmlpublisher plugin but cannot get them to print it as a build report.
Also, I want to keep only one file and not have multiple files doing multiple things. Is it possible?
This is the last stage from the pipeline
stage("publish HTML Table") {
steps {
script {
def outputhtml = sh returnStdout: true, script: 'ls -atrl ./output |tail -1|cut -d" " -f11'
println outputhtml
def htmlfolder = "output/".concat(outputhtml)
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, escapeUnderscores: false, keepAll: false, reportDir: htmlfolder, reportFiles: 'final_result.html', reportName: 'Vulnerability Test Report', reportTitles:''])
createSummary(icon:"star-gold.png",text: "${outputhtml}")
}
}
}
edit:
createSummary(icon: "notepad.png", text: readFile('./'.concat(html_folder.trim().concat("/${final_html}".trim()))))
This works. There was a dependency issue. https://plugins.jenkins.io/badge/ is the plugin that we need.

How to keep appium capabilities in json file and call in code

Following is my appium capability set to run a test
cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.PLATFORM, "Android");
cap.setCapability(CapabilityType.VERSION, "5.1.0");
cap.setCapability("deviceName", "mygeny510");
cap.setCapability("appPackage", "com.android.dialer");
cap.setCapability("appActivity", "com.android.dialer.DialtactsActivity");
driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), cap);
I want to keep the capabilities in a apm.json file
[
{
"platformName": "android",
"appPackage":"com.android.dialer",
"appActivity": "com.android.dialer.DialtactsActivity",
"deviceName": "mygeny510"
}
]
Now can anyone help to call the apm.json into the code instead writing each capabilities by using cap.setcapability(,)
You can place all the desired capabilities on to a seperate file and load the file in an other file for referencing it.
For eg,
I have the desired capabilities in env.rb
def abc
{
caps:
{
platformName: "iOS",
deviceName: "",
udid: "",
app: (File.join(File.dirname(__FILE__), "")),
bundleId: "",
automationName: "XCUITest",
xcodeOrgId: "",
xcodeSigningId: "",
platformVersion: "9.3.2",
noReset: "true",
fullReset: "false",
showIOSLog: "true"
}
}
end
Now you can go to the file where you want to launch this desired capabilities. For this, you would need to load the .json file into this file. I have used require_relative to load the file in order to call the method. Once you do that, you can start the session with
def AnyName
Appium::Driver.new(abc) #Pass capabilities for appium inside the driver
Appium.promote_appium_methods Object #Makes all appium_lib methods accessible from steps
$driver.start_driver #Starts appium driver before the tests begin
end
Hope this helps!

How to parse json string in vb6

I'm calling a web service in VB6 which returns a json string as response. I'm able to hold the response in a string. now I want to show the each parameter separately how can I extract the values from the string ?. a sample string is here :
{
"id": "22144",
"t" : "AAPL",
"e" : "NASDAQ",
"l" : "108.00",
"l_fix" : "108.00",
"l_cur" : "108.00",
"s": "2",
"ltt":"4:00PM EDT",
"lt" : "Aug 10, 4:00PM EDT",
"lt_dts" : "2016-08-10T16:00:01Z",
"c" : "-0.81",
"c_fix" : "-0.81",
"cp" : "-0.74",
"cp_fix" : "-0.74",
"ccol" : "chr",
"pcls_fix" : "108.81",
"el": "107.98",
"el_fix": "107.98",
"el_cur": "107.98",
"elt" : "Aug 10, 5:16PM EDT",
"ec" : "-0.02",
"ec_fix" : "-0.02",
"ecp" : "-0.02",
"ecp_fix" : "-0.02",
"eccol" : "chr",
"div" : "0.57",
"yld" : "2.11"
}
I've found VB-JSON works really well for parsing json in VB6.
You can download it from here.
VB-JSON: A Visual Basic 6 (VB6) JSON Parser Class Library
The .zip file that you download will contain a sample project and the library, which is called JSON.bas.
The main parser function is JSON.parse and you pass it the json string as parameter.
So in your project, you only need to include / add the JSON.bas file.
Sample Usage (from the sample project) :
Private Sub cmdObjToJSON_Click()
Dim p As Object
Dim sInputJson As String
sInputJson = "{ width: '200', frame: false, height: 130, bodyStyle:'background-color: #ffffcc;',buttonAlign:'right', items: [{ xtype: 'form', url: '/content.asp'},{ xtype: 'form2', url: '/content2.asp'}] }"
MsgBox "Input JSON string: " & sInputJson
' sets p
Set p = JSON.parse(sInputJson)
MsgBox "Parsed object output: " & JSON.toString(p)
MsgBox "Get Bodystyle data: " & p.Item("bodyStyle")
MsgBox "Get Form Url data: " & p.Item("items").Item(1).Item("url")
p.Item("items").Item(1).Add "ExtraItem", "Extra Data Value"
MsgBox "Parsed object output with added item: " & JSON.toString(p)
End Sub
As it applies to your case. Something like the following might work (with some tweaks if needed).
Dim parsedJsonObject As Object
Set parsedJsonObject = JSON.parse(yourJsonStringVariable)
'Print the ticker ( t in your json )
Debug.Print parsedJsonObject.Item("t")
There is a JSON parser library for Visual Basic that you can find in http://json.org/.
You can either use VB-JSON or PW.JSON.

Aws Iot create rule error while creating new rule

I am creating a new rule using the following command
aws iot create-topic-rule --rule-name my-rule --topic-rule-payload file://myrule.json
The content of myrule.json contents is
{
"sql": "SELECT * FROM 'iot/test'",
"ruleDisabled": false,
"awsIotSqlVersion": "2016-03-23-beta",
"actions": [{
"dynamoDB": {
"tableName": "my-dynamodb-table",
"roleArn": "arn:aws:iam::12345*****:role/my-iot-role",
"hashKeyField": "topic",
"hashKeyValue": "${topic(2)}",
"rangeKeyField": "timestamp",
"rangeKeyValue": "${timestamp()}"
}
}]
}
I am getting following error.
A client error (InvalidRequestException) occurred when calling the
CreateTopicRule operation: 1 validation error detected: Value
'my-rule' at 'ruleName' failed to satisfy constraint: Member must
satisfy regular expression pattern: ^[a-zA-Z0-9_]+$
please can someone help?
The regex ^[a-zA-Z0-9_]+$ means you cannot use dashes(-) . Only underscore( _ ) is allowed

Classic ASP Parse JSON Error with ASPJSON.com Library

I'm trying to use GET to parse JSON from a URL with Classic ASP. There seems to be a cross-domain issue. I use the library from http://www.aspjson.com/ and get a '80072efd' msxml3.dll error. Which reads as: "A connection with the server could not be established". This is happening at aj_XmlHttp.send.
Set aj_XmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
aj_XmlHttp.open "GET", inputsource, False
aj_XmlHttp.setRequestHeader "Content-Type", "text/json"
aj_XmlHttp.setRequestHeader "CharSet", "UTF-8"
aj_XmlHttp.Send
I previously tried jsonp to parse the JSON but got an XMLHttpRequest error where nothing would load load due to an Access-Control-Allow-Origin issue.
Here's my code:
Set oJSON = New aspJSON
oJSON.loadJSON("https://api.rtsports.com/daily/xxxxxxx/baseball/period")
Response.Write oJSON.data("sport") & "<br>"
For Each phonenr In oJSON.data("period")
Set this = oJSON.data("period").item(phonenr)
Response.Write _
this.item("start_time") & ": " & _
this.item("end_time") & "<br>"
Next
Response.Write oJSON.JSONoutput()
JSON
"sport": "baseball",
"period": [{
"period_id": "1770",
"sport": "baseball",
"start_time": "Thu May 7 1:10 PM ET",
"end_time": "Fri May 8 12:00 AM ET",
"games": [{
"home_team": "MIN",
"away_team": "OAK",
"start_time": "Thu May 7 1:10 PM ET"
}]
}]
Does anyone know of a way to parse cross-domain JSON using Classic ASP and avoid the connection or Access-Control-Allowed-Origin error? I don't have access to server settings.
Resolved
The problem was that the JSON I was accessing did not have a certificate matching the URL. Instead of accessing it through https I switched to http and had no trouble.
The problem was that the JSON I was accessing did not have a certificate matching the URL. Instead of accessing it through https I switched to http and had no trouble.