Hallo Threema Spezialisten,
ich bin dabei die .NET Web API zu integrieren aber stoße immer wieder auf Fehler beim kompalieren.
Programmieren tue ich in Visual Studio 2017 und möchte alles in einer Web App intigrieren.
Der Quellcode meines Controllers:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Threema.MsgApi;
using Threema.MsgApi.Helpers;
namespace Erste.Controllers
{
public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}
public void senden()
{
string gatewayId = "*LEITERA";
string secret = "SZIsMOOrEuQ8iBaa";
//TODO: implement your own public key store, or use the
//SQLite implementation "PublicKeyStoreDb", to get better performance.
APIConnector apiConnector = new APIConnector(gatewayId, secret, null);
//create the connection
string threemaId = "*LEITERA";
string textMessage = "Simple Mode Message";
byte[] privateKey = Encoding.ASCII.GetBytes("XXXXXXXXXXXXXXXXXXXXXXXXXX");
//byte[] privateKey = DataUtils.ReadKeyFile("Models/privateKey.txt", Key.KeyType.PRIVATE);
E2EHelper e2EHelper = new E2EHelper(apiConnector, privateKey);
string messageId = e2EHelper.SendTextMessage(threemaId, textMessage);
}
}
}
Alles anzeigen
Wie man sieht habe ich die eine standart Zeile auskommentiert und den Schlüssel als String fest definiert, da es sonst immer zu Fehlern kam.
Die Fehler sind:
Code
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler CS0579 Duplicate 'AssemblyTitle' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 8 Aktiv
Fehler CS7027 Error signing output with public key from file 'Threema.MsgApi.snk' -- File not found. msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\CSC 1 Aktiv
Fehler CS0579 Duplicate 'AssemblyDescription' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 9 Aktiv
Fehler CS0579 Duplicate 'AssemblyConfiguration' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 10 Aktiv
Fehler CS0579 Duplicate 'AssemblyCompany' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 11 Aktiv
Fehler CS0579 Duplicate 'AssemblyProduct' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 12 Aktiv
Fehler CS0579 Duplicate 'AssemblyCopyright' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 13 Aktiv
Fehler CS0579 Duplicate 'AssemblyTrademark' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 14 Aktiv
Fehler CS0579 Duplicate 'AssemblyCulture' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 15 Aktiv
Fehler CS0579 Duplicate 'ComVisible' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 20 Aktiv
Fehler CS0579 Duplicate 'Guid' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 23 Aktiv
Fehler CS0579 Duplicate 'AssemblyVersion' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 37 Aktiv
Fehler CS0579 Duplicate 'AssemblyFileVersion' attribute msgapi C:\Users\leiteritza\source\repos\msgapi\msgapi\Threema\Properties\AssemblyInfo.cs 38 Aktiv
Alles anzeigen
Ich verstehe nicht wieso es
nicht finden kann.
Ich habe den gesamten Ordner Threema.MsgApi in das Projekt intigriert wo sich auch diese Datei befindet.
Ich hoffe Sie können mir weiterhelfen.
MFG
Andy Leiteritz