Create NodeSet2 XML (e.g. using SiOME) adding own namespace e.g. http://alexander-koepke.de/opcua/compressor
Use Model Compiler to generate source code dotnet build/bin/Release/net8.0/Opc.Ua.ModelCompiler.dll compile -version v105 -id 42000 -d2 "MyCompressorType.NodeSet2.xml,CompressorSimulationOpcUaServer" -o2 "../shared/generated/compressor"
Observation
Generated source code for the namespace properties is invalid and therefor all references to it:
#region Namespace Declarations
/// <remarks />
[System.CodeDom.Compiler.GeneratedCodeAttribute("Opc.Ua.ModelCompiler", "1.0.0.0")]
public static partial class Namespaces
{
/// <summary>
/// The URI for the alexander-koepkedeopcuacompressor namespace (.NET code namespace is 'CompressorSimulationOpcUaServer').
/// </summary>
public const string alexander-koepkedeopcuacompressor = "http://alexander-koepke.de/opcua/compressor";
/// <summary>
/// The URI for the OpcUa namespace (.NET code namespace is 'Opc.Ua').
/// </summary>
public const string OpcUa = "http://opcfoundation.org/UA/";
}
#endregion
Expected
#region Namespace Declarations
/// <remarks />
[System.CodeDom.Compiler.GeneratedCodeAttribute("Opc.Ua.ModelCompiler", "1.0.0.0")]
public static partial class Namespaces
{
/// <summary>
/// The URI for the alexander-koepkedeopcuacompressor namespace (.NET code namespace is 'CompressorSimulationOpcUaServer').
/// </summary>
public const string alexanderkoepkedeopcuacompressor = "http://alexander-koepke.de/opcua/compressor";
/// <summary>
/// The URI for the OpcUa namespace (.NET code namespace is 'Opc.Ua').
/// </summary>
public const string OpcUa = "http://opcfoundation.org/UA/";
}
#endregion
Repo Steps
http://alexander-koepke.de/opcua/compressor
dotnet build/bin/Release/net8.0/Opc.Ua.ModelCompiler.dll compile -version v105 -id 42000 -d2 "MyCompressorType.NodeSet2.xml,CompressorSimulationOpcUaServer" -o2 "../shared/generated/compressor"
Observation
Generated source code for the namespace properties is invalid and therefor all references to it:
Expected