From 8aff2cb19e57fe7865e122e985d361f82935c1c3 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:03:30 +0200 Subject: [PATCH 01/13] switch tests to net8 --- ToolBoxLibUnitTests/TestCRC.cs | 3 +- ToolBoxLibUnitTests/TestDataBlockReading.cs | 47 ++++---- ToolBoxLibUnitTests/TestLibNoDaveReading.cs | 25 ++-- ToolBoxLibUnitTests/TestMC7Converter.cs | 111 +++++++++--------- ToolBoxLibUnitTests/TestPLCBlockName.cs | 27 +++-- ToolBoxLibUnitTests/TestParameter.cs | 21 ++-- .../ToolBoxLibUnitTests.csproj | 9 +- 7 files changed, 125 insertions(+), 118 deletions(-) diff --git a/ToolBoxLibUnitTests/TestCRC.cs b/ToolBoxLibUnitTests/TestCRC.cs index 1810db0e..40214a95 100644 --- a/ToolBoxLibUnitTests/TestCRC.cs +++ b/ToolBoxLibUnitTests/TestCRC.cs @@ -1,5 +1,6 @@ using DotNetSiemensPLCToolBoxLibrary.General; using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -12,7 +13,7 @@ public void TestCRC16BlockSum() //see: https://www.sps-forum.de/hochsprachen-opc/56412-upload-von-block-zur-s7-2.html var bytes = new byte[] { 0x0C, 0x00, 0x0E, 0xC0, 0x00, 0xC1, 0x00, 0xC3, 0x00, 0xC4, 0x00, 0xC5, 0x00, 0xD8, 0x80, 0x65, 0x00 }; var crc = CrcHelper.GetCrc16(bytes); - Assert.AreEqual(crc, 0x7822); + ClassicAssert.AreEqual(crc, 0x7822); } } } diff --git a/ToolBoxLibUnitTests/TestDataBlockReading.cs b/ToolBoxLibUnitTests/TestDataBlockReading.cs index f8049a2d..4aaeca66 100644 --- a/ToolBoxLibUnitTests/TestDataBlockReading.cs +++ b/ToolBoxLibUnitTests/TestDataBlockReading.cs @@ -3,7 +3,8 @@ using DotNetSiemensPLCToolBoxLibrary.DataTypes.Blocks.Step7V5; using DotNetSiemensPLCToolBoxLibrary.DataTypes.Projectfolders.Step7V5; using DotNetSiemensPLCToolBoxLibrary.DataTypes.AWL.Step7V5; -using NUnit.Framework; +using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -25,14 +26,14 @@ public void TestDB1() .DB, false, fld, blk, new S7ConvertingOptions()); - Assert.AreEqual(test.Children[0].Name, "DB_VAR"); - Assert.AreEqual(test.Children[1].Name, "aa"); - Assert.AreEqual(test.Children[2].Name, "bb"); - Assert.AreEqual(test.Children[3].Name, "aa1"); - Assert.AreEqual(((S7DataRow)test.Children[0]).BlockAddress.ByteAddress, 0); - Assert.AreEqual(((S7DataRow)test.Children[1]).BlockAddress.ByteAddress, 2); - Assert.AreEqual(((S7DataRow)test.Children[2]).BlockAddress.ByteAddress, 10); - Assert.AreEqual(((S7DataRow)test.Children[3]).BlockAddress.ByteAddress, 12); + ClassicAssert.AreEqual(test.Children[0].Name, "DB_VAR"); + ClassicAssert.AreEqual(test.Children[1].Name, "aa"); + ClassicAssert.AreEqual(test.Children[2].Name, "bb"); + ClassicAssert.AreEqual(test.Children[3].Name, "aa1"); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).BlockAddress.ByteAddress, 0); + ClassicAssert.AreEqual(((S7DataRow)test.Children[1]).BlockAddress.ByteAddress, 2); + ClassicAssert.AreEqual(((S7DataRow)test.Children[2]).BlockAddress.ByteAddress, 10); + ClassicAssert.AreEqual(((S7DataRow)test.Children[3]).BlockAddress.ByteAddress, 12); } [Test] @@ -49,12 +50,12 @@ public void TestDB2() .DB, false, fld, blk, new S7ConvertingOptions()); - Assert.AreEqual(test.Children[0].Name, "Fachkoordinate"); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 1); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 2); - Assert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 544); + ClassicAssert.AreEqual(test.Children[0].Name, "Fachkoordinate"); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 1); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 2); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 544); } [Test] @@ -71,14 +72,14 @@ public void TestDB3() .DB, false, fld, blk, new S7ConvertingOptions()); - Assert.AreEqual(test.Children[0].Name, "X_KOORDINATE"); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 0); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[2], 1); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 16); - Assert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[2], 2); - Assert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 4624); + ClassicAssert.AreEqual(test.Children[0].Name, "X_KOORDINATE"); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[0], 0); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[1], 0); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStart[2], 1); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[0], 67); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[1], 16); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ArrayStop[2], 2); + ClassicAssert.AreEqual(((S7DataRow)test.Children[0]).ByteLength, 4624); } [Test] diff --git a/ToolBoxLibUnitTests/TestLibNoDaveReading.cs b/ToolBoxLibUnitTests/TestLibNoDaveReading.cs index 302e018b..3e9bccb4 100644 --- a/ToolBoxLibUnitTests/TestLibNoDaveReading.cs +++ b/ToolBoxLibUnitTests/TestLibNoDaveReading.cs @@ -2,7 +2,8 @@ using System; using System.Collections.Generic; using DotNetSiemensPLCToolBoxLibrary.Communication.LibNoDave; -using NUnit.Framework; +using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -23,7 +24,7 @@ public void TestReading() string t = @"READ Area:132, DBnum:10, Start:10, Bytes:300 READ Area:132, DBnum:60, Start:0, Bytes:300"; - Assert.AreEqual(req.Replace("\r\n", "\n"), t.Replace("\r\n", "\n")); + ClassicAssert.AreEqual(req.Replace("\r\n", "\n"), t.Replace("\r\n", "\n")); //var wrapper2 = new ConnectionWrapper(480); //var conn2 = new PLCConnection(new PLCConnectionConfiguration(), wrapper2); @@ -34,7 +35,7 @@ public void TestReading() //var pdus2 = wrapper2.PDUs; //string req2 = string.Join(Environment.NewLine, pdus2); //string t2 = "READ Area:132, DBnum:10, Start:10, Bytes:300\r\nREAD Area:132, DBnum:60, Start:0, Bytes:300"; - //Assert.AreEqual(req2, t2); + //ClassicAssert.AreEqual(req2, t2); var wrapper3 = new ConnectionWrapper(480); var conn3 = new PLCConnection(new PLCConnectionConfiguration(), wrapper3); @@ -45,7 +46,7 @@ public void TestReading() var pdus3 = wrapper3.PDUs; string req3 = string.Join(Environment.NewLine, pdus3); string t3 = "READ Area:132, DBnum:10, Start:10, Bytes:300\r\nREAD Area:132, DBnum:60, Start:0, Bytes:140\r\nREAD Area:132, DBnum:60, Start:140, Bytes:160"; - Assert.AreEqual(req3.Replace("\r\n", "\n"), t3.Replace("\r\n", "\n")); + ClassicAssert.AreEqual(req3.Replace("\r\n", "\n"), t3.Replace("\r\n", "\n")); var wrapper4 = new ConnectionWrapper(480); var conn4 = new PLCConnection(new PLCConnectionConfiguration(), wrapper4); @@ -60,7 +61,7 @@ public void TestReading() var pdus4 = wrapper4.PDUs; string req4 = string.Join(Environment.NewLine, pdus4); string t4 = "READ Area:132, DBnum:1, Start:0, Bytes:14\r\nREAD Area:132, DBnum:1, Start:30, Bytes:4\r\nREAD Area:132, DBnum:1, Start:50, Bytes:4\r\nREAD Area:132, DBnum:1, Start:80, Bytes:4"; - Assert.AreEqual(req4.Replace("\r\n", "\n"), t4.Replace("\r\n", "\n")); + ClassicAssert.AreEqual(req4.Replace("\r\n", "\n"), t4.Replace("\r\n", "\n")); var wrapper5 = new ConnectionWrapper(240); var conn5 = new PLCConnection(new PLCConnectionConfiguration(), wrapper5); @@ -85,7 +86,7 @@ public void TestReading() var pdus5 = wrapper5.PDUs; string req5 = string.Join(Environment.NewLine, pdus5); string t5 = "READ Area:132, DBnum:1, Start:0, Bytes:14\r\nREAD Area:132, DBnum:1, Start:30, Bytes:4\r\nREAD Area:132, DBnum:1, Start:50, Bytes:4\r\nREAD Area:132, DBnum:1, Start:80, Bytes:4\r\nREAD Area:132, DBnum:1, Start:90, Bytes:30\r\nREAD Area:132, DBnum:1, Start:140, Bytes:4\r\nREAD Area:132, DBnum:1, Start:160, Bytes:4\r\nREAD Area:132, DBnum:1, Start:180, Bytes:44\r\nREAD Area:132, DBnum:1, Start:230, Bytes:24\r\nREAD Area:132, DBnum:1, Start:260, Bytes:4\r\nREAD Area:132, DBnum:1, Start:270, Bytes:4"; - Assert.AreEqual(req5.Replace("\r\n", "\n"), t5.Replace("\r\n", "\n")); + ClassicAssert.AreEqual(req5.Replace("\r\n", "\n"), t5.Replace("\r\n", "\n")); //var tag=new PLCNckTag() { TagDataType = TagDataType.Float, NckArea = 0xa, NckUnit = 0x8,NckColumn = 0x23, NckLine = 0x1,NckModule = 0x1a,NckLinecount = 0x1}; } @@ -103,7 +104,7 @@ public void TestReading2() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:2, Start:0, Bytes:3"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } [Test] @@ -134,7 +135,7 @@ public void TestReading3() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:781, Start:3, Bytes:11"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } [Test] @@ -151,7 +152,7 @@ public void TestReading4() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:781, Start:5, Bytes:6"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } [Test] @@ -169,7 +170,7 @@ public void TestReading5() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:781, Start:5, Bytes:11"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } [Test] @@ -187,7 +188,7 @@ public void TestReading6() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:781, Start:5, Bytes:11"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } class ConnectionWrapperResult : ConnectionWrapper @@ -243,7 +244,7 @@ public void TestReading7() var pdus = wrapper.PDUs; string req = string.Join(Environment.NewLine, pdus); string t = "READ Area:132, DBnum:781, Start:0, Bytes:6"; - Assert.AreEqual(req, t); + ClassicAssert.AreEqual(req, t); } } diff --git a/ToolBoxLibUnitTests/TestMC7Converter.cs b/ToolBoxLibUnitTests/TestMC7Converter.cs index a9c8d07e..ebc7b410 100644 --- a/ToolBoxLibUnitTests/TestMC7Converter.cs +++ b/ToolBoxLibUnitTests/TestMC7Converter.cs @@ -4,6 +4,7 @@ using DotNetSiemensPLCToolBoxLibrary.DataTypes; using System.Collections.Generic; using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -29,11 +30,11 @@ public void ParseDataBlocks() block = File.ReadAllBytes(dir + "DB121.bin"); S7DataBlock DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.DB, DB.BlockType); - Assert.AreEqual(121, DB.BlockNumber); - Assert.AreEqual(21418, DB.Length); //Load memory Size - Assert.AreEqual(20824, DB.CodeSize); //Data size, this is the relevant data length - Assert.AreEqual(File.ReadAllText(dir + "DB121.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType); + ClassicAssert.AreEqual(121, DB.BlockNumber); + ClassicAssert.AreEqual(21418, DB.Length); //Load memory Size + ClassicAssert.AreEqual(20824, DB.CodeSize); //Data size, this is the relevant data length + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB121.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); //_____________________________________________________________________________ //Read Data-block With long Array of Structs @@ -41,11 +42,11 @@ public void ParseDataBlocks() block = File.ReadAllBytes(dir + "DB13.bin"); DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.DB, DB.BlockType); - Assert.AreEqual(13, DB.BlockNumber); - Assert.AreEqual(64214, DB.Length); //Load memory Size - Assert.AreEqual(64040, DB.CodeSize); //Data size, this is the relevant data length - Assert.AreEqual(File.ReadAllText(dir + "DB13.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType); + ClassicAssert.AreEqual(13, DB.BlockNumber); + ClassicAssert.AreEqual(64214, DB.Length); //Load memory Size + ClassicAssert.AreEqual(64040, DB.CodeSize); //Data size, this is the relevant data length + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB13.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); //_____________________________________________________________________________ //Read Data-block With array and single Static Reals @@ -53,11 +54,11 @@ public void ParseDataBlocks() block = File.ReadAllBytes(dir + "DB4.bin"); DB = (S7DataBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.DB, DB.BlockType); - Assert.AreEqual(4, DB.BlockNumber); - Assert.AreEqual(8094, DB.Length); //Load memory Size - Assert.AreEqual(6000, DB.CodeSize); //Data size, this is the relevant data length - Assert.AreEqual(File.ReadAllText(dir + "DB4.awl").Trim().Replace("\r\n", "\n"), DB.Structure.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(PLCBlockType.DB, DB.BlockType); + ClassicAssert.AreEqual(4, DB.BlockNumber); + ClassicAssert.AreEqual(8094, DB.Length); //Load memory Size + ClassicAssert.AreEqual(6000, DB.CodeSize); //Data size, this is the relevant data length + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB4.awl").Trim().Replace("\r\n", "\n"), DB.Structure.ToString().Trim().Replace("\r\n", "\n")); } [Test] @@ -71,21 +72,21 @@ public void ParseFunctionCodeBlocks() block = File.ReadAllBytes(dir + "FC1.bin"); S7FunctionBlock FC = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.FC, FC.BlockType); - Assert.AreEqual(1, FC.BlockNumber); - Assert.AreEqual(434, FC.Length); //Load memory Size - Assert.AreEqual(342, FC.CodeSize); //Code size of pure MC7 - Assert.AreEqual(6, FC.LocalDataSize); //Actually there are no "Temp" but the local data is needed for the "Call"'s - Assert.AreEqual(4, FC.Networks.Count); + ClassicAssert.AreEqual(PLCBlockType.FC, FC.BlockType); + ClassicAssert.AreEqual(1, FC.BlockNumber); + ClassicAssert.AreEqual(434, FC.Length); //Load memory Size + ClassicAssert.AreEqual(342, FC.CodeSize); //Code size of pure MC7 + ClassicAssert.AreEqual(6, FC.LocalDataSize); //Actually there are no "Temp" but the local data is needed for the "Call"'s + ClassicAssert.AreEqual(4, FC.Networks.Count); //Some of the called functions List tmp = new List(FC.CalledBlocks); - Assert.AreEqual("FC96", tmp[2]); - Assert.AreEqual("FC97", tmp[7]); - Assert.AreEqual("FC16", tmp[11]); - Assert.AreEqual("FC21", tmp[13]); + ClassicAssert.AreEqual("FC96", tmp[2]); + ClassicAssert.AreEqual("FC97", tmp[7]); + ClassicAssert.AreEqual("FC16", tmp[11]); + ClassicAssert.AreEqual("FC21", tmp[13]); - Assert.AreEqual(File.ReadAllText(dir + "FC1.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "FC1.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n")); //_____________________________________________________________________________ //Read complex Function-code @@ -94,21 +95,21 @@ public void ParseFunctionCodeBlocks() block = File.ReadAllBytes(dir + "FC100.bin"); FC = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.FC, FC.BlockType); - Assert.AreEqual(100, FC.BlockNumber); - Assert.AreEqual(4182, FC.Length); //Load memory Size - Assert.AreEqual(3882, FC.CodeSize); //Code size of pure MC7 - Assert.AreEqual(58, FC.LocalDataSize); - Assert.AreEqual(9, FC.Networks.Count); + ClassicAssert.AreEqual(PLCBlockType.FC, FC.BlockType); + ClassicAssert.AreEqual(100, FC.BlockNumber); + ClassicAssert.AreEqual(4182, FC.Length); //Load memory Size + ClassicAssert.AreEqual(3882, FC.CodeSize); //Code size of pure MC7 + ClassicAssert.AreEqual(58, FC.LocalDataSize); + ClassicAssert.AreEqual(9, FC.Networks.Count); //Some of the called functions tmp = new List(FC.CalledBlocks); - Assert.AreEqual("SFC20", tmp[0]); - Assert.AreEqual("FC6", tmp[6]); - Assert.AreEqual("FC[LW16]", tmp[18]); - Assert.AreEqual("SFC20", tmp[22]); + ClassicAssert.AreEqual("SFC20", tmp[0]); + ClassicAssert.AreEqual("FC6", tmp[6]); + ClassicAssert.AreEqual("FC[LW16]", tmp[18]); + ClassicAssert.AreEqual("SFC20", tmp[22]); - Assert.AreEqual(File.ReadAllText(dir + "FC100.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "FC100.awl").Trim().Replace("\r\n", "\n"), FC.ToString().Trim().Replace("\r\n", "\n")); } [Test] @@ -121,33 +122,33 @@ public void ParseFunctionBlocks() block = File.ReadAllBytes(dir + "FB101.bin"); S7FunctionBlock FB = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.FB, FB.BlockType); - Assert.AreEqual(101, FB.BlockNumber); - Assert.AreEqual(128, FB.Length); //Load memory Size - Assert.AreEqual(24, FB.CodeSize); //Code size of pure MC7 - Assert.AreEqual(4, FB.LocalDataSize); - Assert.AreEqual(3, FB.Networks.Count); + ClassicAssert.AreEqual(PLCBlockType.FB, FB.BlockType); + ClassicAssert.AreEqual(101, FB.BlockNumber); + ClassicAssert.AreEqual(128, FB.Length); //Load memory Size + ClassicAssert.AreEqual(24, FB.CodeSize); //Code size of pure MC7 + ClassicAssert.AreEqual(4, FB.LocalDataSize); + ClassicAssert.AreEqual(3, FB.Networks.Count); //Some of the called functions List tmp = new List(FB.CalledBlocks); - Assert.AreEqual("FC100", tmp[0]); + ClassicAssert.AreEqual("FC100", tmp[0]); - Assert.AreEqual(File.ReadAllText(dir + "FB101.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "FB101.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n")); //_____________________________________________________________________________ //Read Function-Block with Instance data block = File.ReadAllBytes(dir + "FB1001.bin"); FB = (S7FunctionBlock)DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx.MC7.MC7Converter.GetAWLBlock(block, MnemonicLanguage.German); - Assert.AreEqual(PLCBlockType.FB, FB.BlockType); - Assert.AreEqual(1001, FB.BlockNumber); - Assert.AreEqual(126, FB.Length); //Load memory Size - Assert.AreEqual(22, FB.CodeSize); //Code size of pure MC7 - Assert.AreEqual(0, FB.LocalDataSize); //No temp data, all data is in STAT - Assert.AreEqual(1, FB.Networks.Count); + ClassicAssert.AreEqual(PLCBlockType.FB, FB.BlockType); + ClassicAssert.AreEqual(1001, FB.BlockNumber); + ClassicAssert.AreEqual(126, FB.Length); //Load memory Size + ClassicAssert.AreEqual(22, FB.CodeSize); //Code size of pure MC7 + ClassicAssert.AreEqual(0, FB.LocalDataSize); //No temp data, all data is in STAT + ClassicAssert.AreEqual(1, FB.Networks.Count); string t = FB.ToString(); - Assert.AreEqual(File.ReadAllText(dir + "FB1001.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "FB1001.awl").Trim().Replace("\r\n", "\n"), FB.ToString().Trim().Replace("\r\n", "\n")); } @@ -160,7 +161,7 @@ public void ParseFBWithoutSegmentTAble() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FB751.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "This block contains an unconditional call of an IN.Block_FB parameter without Parameters 'UC #IN2'")] @@ -172,7 +173,7 @@ public void ParseFcWithParameterlessUnconditionalCall() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FC21.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "This contains a complex DB")] @@ -184,7 +185,7 @@ public void ParseComplexDB() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. //string AWL = File.ReadAllText(dir + "FC21.awl").Trim().Replace("\r\n", "\n"); - //Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + //ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } } } diff --git a/ToolBoxLibUnitTests/TestPLCBlockName.cs b/ToolBoxLibUnitTests/TestPLCBlockName.cs index 38cc5777..9ed1cf5f 100644 --- a/ToolBoxLibUnitTests/TestPLCBlockName.cs +++ b/ToolBoxLibUnitTests/TestPLCBlockName.cs @@ -1,5 +1,6 @@ using DotNetSiemensPLCToolBoxLibrary.DataTypes; -using NUnit.Framework; +using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -10,28 +11,28 @@ public class TestPLCBlockName public void TestParse() { PLCBlockName test = new PLCBlockName("DB5"); - Assert.AreEqual(5, test.BlockNumber); - Assert.AreEqual(PLCBlockType.DB, test.BlockType); + ClassicAssert.AreEqual(5, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.DB, test.BlockType); test = new PLCBlockName("db 5"); - Assert.AreEqual(5, test.BlockNumber); - Assert.AreEqual(PLCBlockType.DB, test.BlockType); + ClassicAssert.AreEqual(5, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.DB, test.BlockType); test = new PLCBlockName("FC109"); - Assert.AreEqual(109, test.BlockNumber); - Assert.AreEqual(PLCBlockType.FC, test.BlockType); + ClassicAssert.AreEqual(109, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.FC, test.BlockType); test = new PLCBlockName("FB9999"); - Assert.AreEqual(9999, test.BlockNumber); - Assert.AreEqual(PLCBlockType.FB, test.BlockType); + ClassicAssert.AreEqual(9999, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.FB, test.BlockType); test = new PLCBlockName("SDB189"); - Assert.AreEqual(189, test.BlockNumber); - Assert.AreEqual(PLCBlockType.SDB, test.BlockType); + ClassicAssert.AreEqual(189, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.SDB, test.BlockType); test = new PLCBlockName("OB1"); - Assert.AreEqual(1, test.BlockNumber); - Assert.AreEqual(PLCBlockType.OB, test.BlockType); + ClassicAssert.AreEqual(1, test.BlockNumber); + ClassicAssert.AreEqual(PLCBlockType.OB, test.BlockType); try { diff --git a/ToolBoxLibUnitTests/TestParameter.cs b/ToolBoxLibUnitTests/TestParameter.cs index 40c9906e..41b059d1 100644 --- a/ToolBoxLibUnitTests/TestParameter.cs +++ b/ToolBoxLibUnitTests/TestParameter.cs @@ -4,6 +4,7 @@ using DotNetSiemensPLCToolBoxLibrary.DataTypes; using System.Collections.Generic; using NUnit.Framework; +using NUnit.Framework.Legacy; namespace ToolBoxLibUnitTests { @@ -32,7 +33,7 @@ public void ParseDatablockWithBooleanInitialValues() //General Structure must be the same string Test = DB.ToString().Trim().Replace("\r\n", "\n"); - Assert.AreEqual(File.ReadAllText(dir + "DB3001.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3001.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Datablock with Real and Integers and some of them, not all of them, defined as having Initial Values")] @@ -43,7 +44,7 @@ public void ParseDatablockWithRealInitialValues() //General Structure must be the same string Test = DB.ToString().Trim().Replace("\r\n", "\n"); - Assert.AreEqual(File.ReadAllText(dir + "DB3002.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3002.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Datablock with Complex data, containing Arrays with non zero Lower bounds, DateAndTime ans Strings. All of them have initial values. This is one of the most complex Block interfaces to construct")] @@ -55,7 +56,7 @@ public void ParseDatablockWithComplexInitialValues() //General Structure must be the same string Test = DB.ToString().Trim().Replace("\r\n", "\n"); string AWL = File.ReadAllText(dir + "DB3003.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Datablock with multi dimensional Arrays")] @@ -66,7 +67,7 @@ public void ParseDatablockWithMultiDimensionalArrays() //General Structure must be the same string Test = DB.ToString().Trim().Replace("\r\n", "\n"); - Assert.AreEqual(File.ReadAllText(dir + "DB3004.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3004.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Datablock with two UDT's")] @@ -77,7 +78,7 @@ public void ParseDatablockWithUDT() //General Structure must be the same string Test = DB.ToString().Trim().Replace("\r\n", "\n"); - Assert.AreEqual(File.ReadAllText(dir + "DB3005.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(File.ReadAllText(dir + "DB3005.awl").Trim().Replace("\r\n", "\n"), DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Function block with very complex Interface, using all Interface types and Initial Values")] @@ -89,7 +90,7 @@ public void ParseFunctionBlockComplexInterface() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FB3003.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Function block with Multi Instance funcionalities")] @@ -101,7 +102,7 @@ public void ParseFunctionBlockMultiInstance() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FB80.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "Parse Function block with BLOCK_XX Parameters and some Multi Instance Parameters")] @@ -113,7 +114,7 @@ public void ParseBlockParameter() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FB3004.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } @@ -127,7 +128,7 @@ public void ParseUnusualDataBlock() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "DB310.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } [Test(Description = "There are 'Extended' versions for each Parameter type. Parse these")] @@ -139,7 +140,7 @@ public void ParseParameterTypesExtended() //Fix up different culture dependent Date conversion //this might not be optimal, but i dont have any better solution at the moment. string AWL = File.ReadAllText(dir + "FB41.awl").Trim().Replace("\r\n", "\n"); - Assert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); + ClassicAssert.AreEqual(AWL, DB.ToString().Trim().Replace("\r\n", "\n")); } } } diff --git a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj index 36243d5c..c07231ee 100644 --- a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj +++ b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj @@ -1,15 +1,16 @@ - + false Library - net462 + net8-windows true - - + + + From bfc6c278863a3e0582605b22a1654bfdf6bb8b63 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:16:00 +0200 Subject: [PATCH 02/13] update nuget packages --- BackupS7/BackupS7.csproj | 2 +- .../JFK-ProtokollerConfigurationTool.csproj | 4 ++-- .../JFK-ProtokollerService.csproj | 1 + .../Databases/PostgreSQL/PostgreSQLStorage.cs | 4 ++-- .../JFK-ProtokollerLibrary.csproj | 14 +++++++------- .../DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj | 2 +- ...DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj | 2 +- .../DotNetSiemensPLCToolBoxLibrary.WinForms.csproj | 10 +++++----- .../DotNetSiemensPLCToolBoxLibrary.csproj | 6 +++--- .../S7ProjectBlockComparer.csproj | 6 +++--- SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj | 4 ++-- WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj | 2 +- WPFVarTab/WPFVarTab.csproj | 4 ++-- 19 files changed, 37 insertions(+), 36 deletions(-) diff --git a/BackupS7/BackupS7.csproj b/BackupS7/BackupS7.csproj index c6a72a8b..b83be9c5 100644 --- a/BackupS7/BackupS7.csproj +++ b/BackupS7/BackupS7.csproj @@ -8,7 +8,7 @@ AnyCPU - + diff --git a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj index ad7b8a41..746a9591 100644 --- a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj +++ b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj @@ -15,8 +15,8 @@ - - + + diff --git a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj index 46844c51..c383e98a 100644 --- a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj +++ b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs index e9b513bc..b21b7183 100644 --- a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs +++ b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/Databases/PostgreSQL/PostgreSQLStorage.cs @@ -83,7 +83,7 @@ public override void CreateOrModify_TablesAndFields(string dataTable, DatasetCon } catch (Npgsql.PostgresException ex) { - if (ex.Code != "42P04") + if (ex.SqlState != "42P04") { Logging.LogText("Database could not be created. Storage: " + myConfig.Name, ex, Logging.LogLevel.Error); throw ex; @@ -103,7 +103,7 @@ public override void CreateOrModify_TablesAndFields(string dataTable, DatasetCon } catch (Npgsql.PostgresException ex) { - if (ex.Code == "42P01") + if (ex.SqlState == "42P01") { try { diff --git a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj index 4774a563..16f35592 100644 --- a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj +++ b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj @@ -10,14 +10,14 @@ - - + + - - - - - + + + + + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj index 0c2987ba..6d8a14da 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV13/DotNetSiemensPLCToolBoxLibrary.TIAV13.csproj @@ -22,7 +22,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj index 23d27cb5..59c81830 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1/DotNetSiemensPLCToolBoxLibrary.TIAV14SP1.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj index 759d64d6..62ef7c4f 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV15/DotNetSiemensPLCToolBoxLibrary.TIAV15.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj index ce7070c1..ddf9de10 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV15_1/DotNetSiemensPLCToolBoxLibrary.TIAV15_1.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj index 3da086c0..eef72082 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV16/DotNetSiemensPLCToolBoxLibrary.TIAV16.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj index d4c790f5..cc359fb7 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV17/DotNetSiemensPLCToolBoxLibrary.TIAV17.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj index 78b2fef9..519b3e6b 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV18/DotNetSiemensPLCToolBoxLibrary.TIAV18.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj b/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj index 6fff09b5..7f5a65c1 100644 --- a/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj +++ b/DotNetSiemensPLCToolBoxLibrary.TIAV19/DotNetSiemensPLCToolBoxLibrary.TIAV19.csproj @@ -23,7 +23,7 @@ snupkg - + diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj index e8ebdce7..44a43b08 100644 --- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj +++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj @@ -2,7 +2,7 @@ false Library - netcoreapp3.0;net461 + net6.0-windows;net461 true @@ -22,13 +22,13 @@ snupkg - + - + - - + + diff --git a/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj b/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj index e55c57f6..b1bc6050 100644 --- a/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj +++ b/LibNoDaveConnectionLibrary/DotNetSiemensPLCToolBoxLibrary.csproj @@ -23,7 +23,7 @@ snupkg - + @@ -38,7 +38,7 @@ - + SHARPZIPLIB;NETSTANDARD @@ -47,6 +47,6 @@ 5.0.0 - + \ No newline at end of file diff --git a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj index 35527261..33d8b155 100644 --- a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj +++ b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj @@ -2,7 +2,7 @@ false WinExe - net462 + net48 true @@ -14,8 +14,8 @@ - - + + diff --git a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj index 93aa5b11..543b9644 100644 --- a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj +++ b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj @@ -2,12 +2,12 @@ false WinExe - net461 + net48 true true - + diff --git a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj index 6f491338..2a1a03d1 100644 --- a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj +++ b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj @@ -18,7 +18,7 @@ - + diff --git a/WPFVarTab/WPFVarTab.csproj b/WPFVarTab/WPFVarTab.csproj index 93e51aa4..b718c72b 100644 --- a/WPFVarTab/WPFVarTab.csproj +++ b/WPFVarTab/WPFVarTab.csproj @@ -13,8 +13,8 @@ - - + + From 790f0cfb20686246bb24cdf154dbb2bf2f7d6a59 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:22:25 +0200 Subject: [PATCH 03/13] work on github build --- .github/workflows/build-pull.yml | 27 ++++++++++++++ .github/workflows/build.yml | 28 +++++++++++++++ .github/workflows/release.yml | 47 +++++++++++++++++++++++++ appveyor.yml | 60 -------------------------------- 4 files changed, 102 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/build-pull.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/build-pull.yml b/.github/workflows/build-pull.yml new file mode 100644 index 00000000..b376949a --- /dev/null +++ b/.github/workflows/build-pull.yml @@ -0,0 +1,27 @@ +name: .NET Pull Request + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: | + dotnet restore src/S7CommPlusDriver + dotnet restore src/DriverTest + dotnet restore src/S7CommPlusGUIBrowser + - name: Build + run: | + dotnet build src/S7CommPlusDriver + dotnet build src/DriverTest + dotnet build src/S7CommPlusGUIBrowser diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a72f11b1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: .NET + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Fetch history + run: git fetch --prune --unshallow + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 5.0.x + 6.0.x + 8.0.x + - name: Restore dependencies + run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln + - name: Build + run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1e0dbea1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: .NET + +on: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Fetch history + run: git fetch --prune --unshallow + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: | + dotnet restore src/S7CommPlusDriver + dotnet restore src/DriverTest + dotnet restore src/S7CommPlusGUIBrowser + + - name: Update project version + uses: roryprimrose/set-vs-sdk-project-version@v1 + with: + version: ${{ github.event.release.tag_name }} + assemblyVersion: ${{ github.event.release.tag_name }} + fileVersion: ${{ github.event.release.tag_name }} + informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }} + + - name: Build + run: | + dotnet build src/S7CommPlusDriver + dotnet build src/DriverTest + dotnet build src/S7CommPlusGUIBrowser + + - name: Publish NuGet + # You may pin to the exact commit or the version. + # uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc + uses: brandedoutcast/publish-nuget@v2.5.5 + with: + # Filepath of the project to be packaged, relative to root of repository + PROJECT_FILE_PATH: MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider.csproj + NUGET_KEY: ${{secrets.NUGET_API_KEY}} diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 76b131af..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,60 +0,0 @@ -image: Visual Studio 2019 - -version: 4.0.{build} - -branches: - only: - - master - -dotnet_csproj: - patch: true - file: '**\*.csproj' - version: '{version}' - package_version: '{version}' - assembly_version: '{version}' - file_version: '{version}' - informational_version: '{version}' - -configuration: Debug - -install: - - cmd: choco install dotnetcore-sdk --pre - -before_build: - - cmd.exe /c externalDlls\libnodave\vcwinmake_64.bat - - cmd.exe /c externalDlls\libnodave\vcwinmake.bat - - externalDlls\copydlls.bat - - nuget restore - -build: - project: DotNetSiemensPLCToolBoxLibrary.sln - -after_build: - - 7z a TiaGitHandler.zip %APPVEYOR_BUILD_FOLDER%\TiaGitHandler\bin\Debug\net48\*.* - - 7z a WPFVarTab.zip %APPVEYOR_BUILD_FOLDER%\WPFVarTab\bin\Debug\net462\*.* - - 7z a Protokoller.zip %APPVEYOR_BUILD_FOLDER%\DotNetDatenbankProtokollerV2\DotNetSimaticDatabaseProtokollerService\bin\Debug\net462\*.* - - 7z a S7ToolBox.zip %APPVEYOR_BUILD_FOLDER%\TestProjectFileFunctions\bin\Debug\net48\*.* - -artifacts: - - path: externalDlls\libnodave\libnodave_jfkmod.dll - name: libnodave_jfkmod.dll - - path: externalDlls\libnodave\libnodave_jfkmod64.dll - name: libnodave_jfkmod64.dll - - path: '**\DotNetSiemensPLCToolBoxLibrary*.*nupkg' - - path: TiaGitHandler.zip - name: TiaGitHandler - - path: S7ToolBox.zip - name: S7ToolBox - - path: WPFVarTab.zip - name: WPFVarTab - - path: Protokoller.zip - name: Protokoller - -deploy: - provider: NuGet - api_key: - secure: qGLYnLmoAwOz2buRk5Nx5ouhilFDBQf8ktSQ0+EDKPKNUq/xmbfM1kWKt9c1O8YI - artifact: /.*DotNetProjects\.DotNetSiemensPLCToolBoxLibrary.*nupkg/ - - - From eaffda949c3bab98e07b00c39fdff7e0203635c3 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:25:39 +0200 Subject: [PATCH 04/13] work on build --- .github/workflows/build-pull.yml | 19 +++++++++---------- .../ToolBoxLibUnitTests.csproj | 1 + 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-pull.yml b/.github/workflows/build-pull.yml index b376949a..6d611ee3 100644 --- a/.github/workflows/build-pull.yml +++ b/.github/workflows/build-pull.yml @@ -11,17 +11,16 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Fetch history + run: git fetch --prune --unshallow - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: | + 5.0.x + 6.0.x + 8.0.x - name: Restore dependencies - run: | - dotnet restore src/S7CommPlusDriver - dotnet restore src/DriverTest - dotnet restore src/S7CommPlusGUIBrowser + run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln - name: Build - run: | - dotnet build src/S7CommPlusDriver - dotnet build src/DriverTest - dotnet build src/S7CommPlusGUIBrowser + run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln diff --git a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj index c07231ee..6397bcad 100644 --- a/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj +++ b/ToolBoxLibUnitTests/ToolBoxLibUnitTests.csproj @@ -6,6 +6,7 @@ true + true From 5fc3d4b453bbc0b1547dbfd83359fb368ce19a0b Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:28:09 +0200 Subject: [PATCH 05/13] mor windows fixes --- .../DotNetSiemensPLCToolBoxLibrary.WinForms.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj index 44a43b08..31eae368 100644 --- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj +++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj @@ -4,6 +4,7 @@ Library net6.0-windows;net461 true + true DotNetProjects.DotNetSiemensPLCToolBoxLibrary.WinForms From 8b29134a09d700a6cddaeb9aa1a2f5756334886c Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:32:45 +0200 Subject: [PATCH 06/13] more windows fixes --- .../DotNetSiemensPLCToolBoxLibrary.WinForms.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj index 31eae368..4f6694f8 100644 --- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj +++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj @@ -27,6 +27,7 @@ + From 190af3afd6d3c8a929f71528061129ed6a7851c0 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:42:28 +0200 Subject: [PATCH 07/13] fix copy on linux --- .../DotNetSiemensPLCToolBoxLibrary.WinForms.csproj | 1 + TiaImporter/TiaImporter.csproj | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj index 4f6694f8..aed26db3 100644 --- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj +++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj @@ -5,6 +5,7 @@ net6.0-windows;net461 true true + false DotNetProjects.DotNetSiemensPLCToolBoxLibrary.WinForms diff --git a/TiaImporter/TiaImporter.csproj b/TiaImporter/TiaImporter.csproj index a9f928c0..9efd62c1 100644 --- a/TiaImporter/TiaImporter.csproj +++ b/TiaImporter/TiaImporter.csproj @@ -9,11 +9,10 @@ - - - - - - + + + + + \ No newline at end of file From 4b76211955f6339aeba443fc591e53c83a6f1b14 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:44:30 +0200 Subject: [PATCH 08/13] again try fix windows build --- .../DotNetSiemensPLCToolBoxLibrary.WinForms.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj index aed26db3..cea1bbf5 100644 --- a/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj +++ b/LibNoDaveConnectionLibrary.WinForms/DotNetSiemensPLCToolBoxLibrary.WinForms.csproj @@ -5,7 +5,7 @@ net6.0-windows;net461 true true - false + true DotNetProjects.DotNetSiemensPLCToolBoxLibrary.WinForms From c8079cd91de7ac1ee6f280c6c78b99b5329c02a7 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Fri, 23 Aug 2024 11:52:05 +0200 Subject: [PATCH 09/13] more windows fixes --- BackupRestoreBlocks/BackupRestoreBlocks.csproj | 1 + BackupS7/BackupS7.csproj | 1 + CommandWhenBitSet/CommandWhenBitSet.csproj | 3 ++- DbfReader/DbfReader.csproj | 1 + .../ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj | 1 + .../JFK-ProtokollerService.csproj | 1 + .../ProtokollerLibrary/JFK-ProtokollerLibrary.csproj | 1 + ExampleWPFVisualization/ExampleWPFVisualization.csproj | 1 + MultipleSPSExample/MultipleSPSExample.csproj | 1 + Projects/Kopplungstester/Kopplungstester.csproj | 1 + ReadSpeedtest/ReadSpeedtest.csproj | 1 + ReadTools/ToolReader.csproj | 1 + S7ProjectBlockComparer/S7ProjectBlockComparer.csproj | 1 + SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj | 1 + SimpleCSharpService/SimpleCSharpService.csproj | 1 + SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj | 1 + TCPForwarder/TCPForwarder.csproj | 1 + TestLibrary/TestLibrary.csproj | 1 + TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj | 3 ++- TestVB/TestVB.vbproj | 1 + TiaGitHandler/TiaGitHandler.csproj | 1 + TiaImporter/TiaImporter.csproj | 1 + WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj | 1 + WPFVarTab/WPFVarTab.csproj | 1 + 24 files changed, 26 insertions(+), 2 deletions(-) diff --git a/BackupRestoreBlocks/BackupRestoreBlocks.csproj b/BackupRestoreBlocks/BackupRestoreBlocks.csproj index d42a19ea..f7a1d55f 100644 --- a/BackupRestoreBlocks/BackupRestoreBlocks.csproj +++ b/BackupRestoreBlocks/BackupRestoreBlocks.csproj @@ -4,6 +4,7 @@ Exe net461 true + true true diff --git a/BackupS7/BackupS7.csproj b/BackupS7/BackupS7.csproj index b83be9c5..0b2797c3 100644 --- a/BackupS7/BackupS7.csproj +++ b/BackupS7/BackupS7.csproj @@ -3,6 +3,7 @@ Exe net461 + true AnyCPU diff --git a/CommandWhenBitSet/CommandWhenBitSet.csproj b/CommandWhenBitSet/CommandWhenBitSet.csproj index 8079575f..27116891 100644 --- a/CommandWhenBitSet/CommandWhenBitSet.csproj +++ b/CommandWhenBitSet/CommandWhenBitSet.csproj @@ -3,7 +3,8 @@ Exe net461 - true + true + true diff --git a/DbfReader/DbfReader.csproj b/DbfReader/DbfReader.csproj index 672656c4..3b408811 100644 --- a/DbfReader/DbfReader.csproj +++ b/DbfReader/DbfReader.csproj @@ -5,6 +5,7 @@ net461 true true + true diff --git a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj index 746a9591..b9daf6b1 100644 --- a/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj +++ b/DotNetDatenbankProtokollerV2/ConfigurationTool/JFK-ProtokollerConfigurationTool.csproj @@ -7,6 +7,7 @@ true DotNetSimaticDatabaseProtokollerConfigurationTool app.manifest + true AnyCPU diff --git a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj index c383e98a..888ffbdd 100644 --- a/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj +++ b/DotNetDatenbankProtokollerV2/DotNetSimaticDatabaseProtokollerService/JFK-ProtokollerService.csproj @@ -4,6 +4,7 @@ WinExe net462 true + true true diff --git a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj index 16f35592..4987010b 100644 --- a/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj +++ b/DotNetDatenbankProtokollerV2/ProtokollerLibrary/JFK-ProtokollerLibrary.csproj @@ -4,6 +4,7 @@ Library net462 true + true diff --git a/ExampleWPFVisualization/ExampleWPFVisualization.csproj b/ExampleWPFVisualization/ExampleWPFVisualization.csproj index 33d388ea..e284635e 100644 --- a/ExampleWPFVisualization/ExampleWPFVisualization.csproj +++ b/ExampleWPFVisualization/ExampleWPFVisualization.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/MultipleSPSExample/MultipleSPSExample.csproj b/MultipleSPSExample/MultipleSPSExample.csproj index 8d274721..0ffbac76 100644 --- a/MultipleSPSExample/MultipleSPSExample.csproj +++ b/MultipleSPSExample/MultipleSPSExample.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/Projects/Kopplungstester/Kopplungstester.csproj b/Projects/Kopplungstester/Kopplungstester.csproj index 054dec6d..48e71aee 100644 --- a/Projects/Kopplungstester/Kopplungstester.csproj +++ b/Projects/Kopplungstester/Kopplungstester.csproj @@ -4,6 +4,7 @@ WinExe net462 true + true true diff --git a/ReadSpeedtest/ReadSpeedtest.csproj b/ReadSpeedtest/ReadSpeedtest.csproj index 67d2fef9..da8a58e4 100644 --- a/ReadSpeedtest/ReadSpeedtest.csproj +++ b/ReadSpeedtest/ReadSpeedtest.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/ReadTools/ToolReader.csproj b/ReadTools/ToolReader.csproj index 8d274721..0ffbac76 100644 --- a/ReadTools/ToolReader.csproj +++ b/ReadTools/ToolReader.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj index 33d8b155..f03f266c 100644 --- a/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj +++ b/S7ProjectBlockComparer/S7ProjectBlockComparer.csproj @@ -4,6 +4,7 @@ WinExe net48 true + true diff --git a/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj b/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj index c4bba0d4..1c0dbe37 100644 --- a/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj +++ b/SimpleCSharpDemonstartion/SimpleCSharpDemonstration.csproj @@ -4,6 +4,7 @@ WinExe net462 true + true diff --git a/SimpleCSharpService/SimpleCSharpService.csproj b/SimpleCSharpService/SimpleCSharpService.csproj index 357d2788..113f9740 100644 --- a/SimpleCSharpService/SimpleCSharpService.csproj +++ b/SimpleCSharpService/SimpleCSharpService.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj index 543b9644..e0743a1a 100644 --- a/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj +++ b/SimpleTcpSocketWPF/SimpleTcpSocketWPF.csproj @@ -4,6 +4,7 @@ WinExe net48 true + true true diff --git a/TCPForwarder/TCPForwarder.csproj b/TCPForwarder/TCPForwarder.csproj index 4bd7e621..3567893c 100644 --- a/TCPForwarder/TCPForwarder.csproj +++ b/TCPForwarder/TCPForwarder.csproj @@ -4,6 +4,7 @@ WinExe net462 true + true diff --git a/TestLibrary/TestLibrary.csproj b/TestLibrary/TestLibrary.csproj index efb639c7..d31dfd23 100644 --- a/TestLibrary/TestLibrary.csproj +++ b/TestLibrary/TestLibrary.csproj @@ -4,6 +4,7 @@ WinExe net461 true + true diff --git a/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj b/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj index fdf7ef61..7e3c8dba 100644 --- a/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj +++ b/TestProjectFileFunctions/ToolboxForSiemensPLCs.csproj @@ -4,7 +4,8 @@ WinExe net48 true - true + true + true diff --git a/TestVB/TestVB.vbproj b/TestVB/TestVB.vbproj index c30307fa..cdd127bd 100644 --- a/TestVB/TestVB.vbproj +++ b/TestVB/TestVB.vbproj @@ -4,6 +4,7 @@ net462 true TestVB.Form1 + true diff --git a/TiaGitHandler/TiaGitHandler.csproj b/TiaGitHandler/TiaGitHandler.csproj index ebc94da5..21a26e86 100644 --- a/TiaGitHandler/TiaGitHandler.csproj +++ b/TiaGitHandler/TiaGitHandler.csproj @@ -6,6 +6,7 @@ net48 true true + true false diff --git a/TiaImporter/TiaImporter.csproj b/TiaImporter/TiaImporter.csproj index 9efd62c1..e8eb990f 100644 --- a/TiaImporter/TiaImporter.csproj +++ b/TiaImporter/TiaImporter.csproj @@ -5,6 +5,7 @@ net48 + true diff --git a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj index 2a1a03d1..f8f8082a 100644 --- a/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj +++ b/WPFToolboxForPLCs/WPFToolboxForSiemensPLCs.csproj @@ -4,6 +4,7 @@ WinExe net462 true + true true diff --git a/WPFVarTab/WPFVarTab.csproj b/WPFVarTab/WPFVarTab.csproj index b718c72b..5e457a9b 100644 --- a/WPFVarTab/WPFVarTab.csproj +++ b/WPFVarTab/WPFVarTab.csproj @@ -5,6 +5,7 @@ net462 true true + true x86 From be13b5844259a300f08a7fbd4b54a9165cdfb551 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Sun, 25 Aug 2024 10:59:37 +0200 Subject: [PATCH 10/13] eork on publish --- .github/workflows/release.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e0dbea1..54b9e0d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,15 +14,14 @@ jobs: - name: Fetch history run: git fetch --prune --unshallow - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: | + 5.0.x + 6.0.x + 8.0.x - name: Restore dependencies - run: | - dotnet restore src/S7CommPlusDriver - dotnet restore src/DriverTest - dotnet restore src/S7CommPlusGUIBrowser - + run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln - name: Update project version uses: roryprimrose/set-vs-sdk-project-version@v1 with: @@ -30,18 +29,7 @@ jobs: assemblyVersion: ${{ github.event.release.tag_name }} fileVersion: ${{ github.event.release.tag_name }} informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }} - - name: Build - run: | - dotnet build src/S7CommPlusDriver - dotnet build src/DriverTest - dotnet build src/S7CommPlusGUIBrowser - - - name: Publish NuGet - # You may pin to the exact commit or the version. - # uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc - uses: brandedoutcast/publish-nuget@v2.5.5 - with: - # Filepath of the project to be packaged, relative to root of repository - PROJECT_FILE_PATH: MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider/MonacoRoslynCompletionProvider.csproj - NUGET_KEY: ${{secrets.NUGET_API_KEY}} + run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln +# - name: Publish Nuget +# run: dotnet nuget push DotNetSiemensPLCToolBoxLibrary.sln --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json From 6579de3f6419e563a7dc4193f32f83724bacd765 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Sun, 25 Aug 2024 11:03:48 +0200 Subject: [PATCH 11/13] run tests on windows --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a72f11b1..db50911d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ^windows-latest steps: - uses: actions/checkout@v4 @@ -25,4 +25,6 @@ jobs: - name: Restore dependencies run: dotnet restore DotNetSiemensPLCToolBoxLibrary.sln - name: Build - run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln \ No newline at end of file + run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln + - name: Test + run: dotnet test DotNetSiemensPLCToolBoxLibrary.sln \ No newline at end of file From 595cdf0995ce5e575d5aabc8292a25c1f858f01b Mon Sep 17 00:00:00 2001 From: jkuehner Date: Sun, 25 Aug 2024 11:05:17 +0200 Subject: [PATCH 12/13] typo --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db50911d..169f3f44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ^windows-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 From e76de95cc9f221503e4a17de65cd57db7ef3df07 Mon Sep 17 00:00:00 2001 From: jkuehner Date: Sun, 25 Aug 2024 11:11:51 +0200 Subject: [PATCH 13/13] release yml --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54b9e0d2..e9024963 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,5 +31,8 @@ jobs: informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }} - name: Build run: dotnet build DotNetSiemensPLCToolBoxLibrary.sln + - uses: actions/upload-artifact@v4 + with: + path: ./**/DotNetProjects.DotNetSiemensPLCToolBoxLibrary*.nupkg # - name: Publish Nuget # run: dotnet nuget push DotNetSiemensPLCToolBoxLibrary.sln --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json