Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>7.0.0</VersionPrefix>
<VersionPrefix>7.2.0</VersionPrefix>
<VersionSuffix>prerelease</VersionSuffix>
<Copyright>Copyright (c) 2026 TrakHound Inc., All Rights Reserved.</Copyright>
<Company>TrakHound Inc.</Company>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,34 @@
</None>
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.6.1 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.6.2 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.7 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net47' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.7.1 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net471' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.7.2 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<!--Conditionally obtain references for the .NET Framework 4.8 target-->
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions build/MTConnect.NET.Builder/MTConnect.NET.Builder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
</ItemGroup>

<ItemGroup>
<None Update="config.development.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config.default.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down
126 changes: 126 additions & 0 deletions build/MTConnect.NET.Builder/config.development.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
publisher: TrakHound Inc.

input: D:\Source-Code\TrakHound\MTConnect.NET
output: D:\Source-Code\TrakHound\MTConnect.NET\build\output\development

versionInfoPath: D:\Source-Code\TrakHound\MTConnect.NET\Directory.build.props
innoSetupPath: c:\\Program Files (x86)\\Inno Setup 6\\iscc

agent:

styles: D:\Source-Code\TrakHound\MTConnect.NET\build\styles
schemas: D:\Source-Code\TrakHound\MTConnect.NET\build\schemas

installer:
projectPath: agent\MTConnect.NET-Agent
applicationName: MTConnect.NET Agent
filename: mtconnect.net-agent
runtimes:
- win-x86
- win-x64
frameworks:
- net10.0
- net9.0
- net8.0
- net7.0
- net6.0
- net48
- net461


docker:
projectPath: agent\MTConnect.NET-Agent
imageName: trakhound/mtconnect.net-agent
images:
- baseImage: 8.0.0-alpine3.18-amd64
runtime: linux-x64
framework: net8.0
- baseImage: 8.0.0-alpine3.18-arm64v8
tag: -arm
runtime: linux-arm64
framework: net8.0


libraries:

- name: Libraries
nugetServer: https://nuget.trakhound.com/nuget
projectConfiguration: Package
authors: TrakHound
repositoryUrl: https://github.com/TrakHound/MTConnect.NET
repositoryBranch: v{VERSION}
packageTags: mtconnect;iiot;iot;cnc;
packageProjectUrl: www.TrakHound.com
packageLicenseExpression: MIT
packageIconUrl: https://www.trakhound.com/static/mtconnect-net-nuget.png
packages:
- name: MTConnect.NET-Common
projectPath: libraries/MTConnect.NET-Common
- name: MTConnect.NET-DeviceFinder
projectPath: libraries/MTConnect.NET-DeviceFinder
- name: MTConnect.NET-HTTP
projectPath: libraries/MTConnect.NET-HTTP
- name: MTConnect.NET-JSON
projectPath: libraries/MTConnect.NET-JSON
- name: MTConnect.NET-JSON-cppagent
projectPath: libraries/MTConnect.NET-JSON-cppagent
- name: MTConnect.NET-MQTT
projectPath: libraries/MTConnect.NET-MQTT
- name: MTConnect.NET-Services
projectPath: libraries/MTConnect.NET-Services
- name: MTConnect.NET-SHDR
projectPath: libraries/MTConnect.NET-SHDR
- name: MTConnect.NET-SysML
projectPath: libraries/MTConnect.NET-SysML
- name: MTConnect.NET-TLS
projectPath: libraries/MTConnect.NET-TLS
- name: MTConnect.NET-XML
projectPath: libraries/MTConnect.NET-XML
- name: MTConnect.NET
projectPath: libraries/MTConnect.NET

- name: Adapter
nugetServer: https://nuget.trakhound.com/nuget
projectConfiguration: Package
authors: TrakHound
repositoryUrl: https://github.com/TrakHound/MTConnect.NET
repositoryBranch: v{VERSION}
packageTags: mtconnect;iiot;iot;cnc;
packageProjectUrl: www.TrakHound.com
packageLicenseExpression: MIT
packageIconUrl: https://www.trakhound.com/static/mtconnect-net-nuget.png
packages:
- name: MTConnect.NET-Applications-Adapter
projectPath: adapter/MTConnect.NET-Applications-Adapter
- name: MTConnect.NET-AdapterModule-MQTT
projectPath: adapter/Modules/MTConnect.NET-AdapterModule-MQTT
- name: MTConnect.NET-AdapterModule-SHDR
projectPath: adapter/Modules/MTConnect.NET-AdapterModule-SHDR

- name: Agent
nugetServer: https://nuget.trakhound.com/nuget
projectConfiguration: Package
authors: TrakHound
repositoryUrl: https://github.com/TrakHound/MTConnect.NET
repositoryBranch: v{VERSION}
packageTags: mtconnect;iiot;iot;cnc;
packageProjectUrl: www.TrakHound.com
packageLicenseExpression: MIT
packageIconUrl: https://www.trakhound.com/static/mtconnect-net-nuget.png
packages:
- name: MTConnect.NET-Applications-Agents
projectPath: agent/MTConnect.NET-Applications-Agents
- name: MTConnect.NET-AgentModule-HttpAdapter
projectPath: agent/Modules/MTConnect.NET-AgentModule-HttpAdapter
- name: MTConnect.NET-AgentModule-HttpServer
projectPath: agent/Modules/MTConnect.NET-AgentModule-HttpServer
- name: MTConnect.NET-AgentModule-MqttAdapter
projectPath: agent/Modules/MTConnect.NET-AgentModule-MqttAdapter
- name: MTConnect.NET-AgentModule-MqttBroker
projectPath: agent/Modules/MTConnect.NET-AgentModule-MqttBroker
- name: MTConnect.NET-AgentModule-MqttRelay
projectPath: agent/Modules/MTConnect.NET-AgentModule-MqttRelay
- name: MTConnect.NET-AgentModule-ShdrAdapter
projectPath: agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter
- name: MTConnect.NET-AgentProcessor-Python
projectPath: agent/Processors/MTConnect.NET-AgentProcessor-Python
57 changes: 53 additions & 4 deletions libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpAssetClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2024 TrakHound Inc., All Rights Reserved.
// Copyright (c) 2026 TrakHound Inc., All Rights Reserved.
// TrakHound Inc. licenses this file to you under the MIT license.

using MTConnect.Assets;
Expand All @@ -20,12 +20,13 @@ namespace MTConnect.Clients
public class MTConnectHttpAssetClient : IMTConnectAssetClient
{
private const int DefaultTimeout = 15000;
private static readonly HttpClient _httpClient;
private static readonly HttpClient _defaultHttpClient;
private readonly HttpClient _httpClient;

static MTConnectHttpAssetClient()
{
_httpClient = new HttpClient();
_httpClient.Timeout = TimeSpan.FromMilliseconds(DefaultTimeout);
_defaultHttpClient = new HttpClient();
_defaultHttpClient.Timeout = TimeSpan.FromMilliseconds(DefaultTimeout);
}


Expand All @@ -42,6 +43,7 @@ static MTConnectHttpAssetClient()
/// <param name="documentFormat">Gets or Sets the Document Format to return</param>
public MTConnectHttpAssetClient(string authority, string assetId, string documentFormat = MTConnect.DocumentFormat.XML)
{
_httpClient = _defaultHttpClient;
Init();
Authority = authority;
AssetId = assetId;
Expand All @@ -64,6 +66,53 @@ public MTConnectHttpAssetClient(string authority, string assetId, string documen
/// <param name="documentFormat">Gets or Sets the Document Format to return</param>
public MTConnectHttpAssetClient(string authority, long count = -1, string type = null, string device = null, string documentFormat = MTConnect.DocumentFormat.XML)
{
_httpClient = _defaultHttpClient;
Init();
Authority = authority;
Device = device;
Type = type;
Count = count;
DocumentFormat = documentFormat;
ContentType = MimeTypes.Get(documentFormat);
}

/// <summary>
/// Initializes a new instance of the MTConnectAssetClient class that is used to perform
/// an Assets request from an MTConnect Agent using the MTConnect HTTP REST Api protocol
/// </summary>
/// <param name="authority">
/// The authority portion consists of the DNS name or IP address associated with an Agent and an optional
/// TCP port number[:port] that the Agent is listening to for incoming Requests from client software applications.
/// If the port number is the default Port 80, port is not required.
/// </param>
/// <param name="assetId">The Id of the requested Asset</param>
/// <param name="documentFormat">Gets or Sets the Document Format to return</param>
public MTConnectHttpAssetClient(HttpClient httpClient, string authority, string assetId, string documentFormat = MTConnect.DocumentFormat.XML)
{
_httpClient = httpClient != null ? httpClient : _defaultHttpClient;
Init();
Authority = authority;
AssetId = assetId;
DocumentFormat = documentFormat;
ContentType = MimeTypes.Get(documentFormat);
}

/// <summary>
/// Initializes a new instance of the MTConnectAssetClient class that is used to perform
/// an Assets request from an MTConnect Agent using the MTConnect HTTP REST Api protocol
/// </summary>
/// <param name="authority">
/// The authority portion consists of the DNS name or IP address associated with an Agent and an optional
/// TCP port number[:port] that the Agent is listening to for incoming Requests from client software applications.
/// If the port number is the default Port 80, port is not required.
/// </param>
/// <param name="type">The Type of Assets to retrieve</param>
/// <param name="device">The Device to retrieve Assets for</param>
/// <param name="count">Specifies the maximum number of MTConnectAssets Response Documents returned in an MTConnectAssets Response Document</param>
/// <param name="documentFormat">Gets or Sets the Document Format to return</param>
public MTConnectHttpAssetClient(HttpClient httpClient, string authority, long count = -1, string type = null, string device = null, string documentFormat = MTConnect.DocumentFormat.XML)
{
_httpClient = httpClient != null ? httpClient : _defaultHttpClient;
Init();
Authority = authority;
Device = device;
Expand Down
Loading
Loading