Um den Lizenzkey zu bekommen muss man in den Produkt Key in https://www.nsoftware.com/lic?prod=SBNHA&grtk=true eingeben, dazu einen Namen, E-Mail – Tel und man bekommt den Lizenzkey per E-Mail zugeschickt.
Archiv der Kategorie: c#
Authentification jwt
Microsoft.IdentityModel.Tokens.SecurityTokenMalformedException: IDX14100: JWT is not well formed, there are no dots (.).
The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'.
---> System.ArgumentException: IDX14101: Unable to decode the payload '[PII of type 'Microsoft.IdentityModel.Logging.SecurityArtifact' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]' as Base64Url encoded string.
---> System.Text.Json.JsonException: IDX11020: The JSON value of type: 'String', could not be converted to 'JsonTokenType.Number'. Reading: 'Microsoft.IdentityModel.JsonWebTokens.JsonWebToken.iat', Position: '185', CurrentDepth: '1', BytesConsumed: '213'.
at Microsoft.IdentityModel.Tokens.Json.JsonSerializerPrimitives.ReadLong(Utf8JsonReader& reader, String propertyName, String className, Boolean read)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebToken.CreatePayloadClaimSet(Byte[] bytes, Int32 length)
at Microsoft.IdentityModel.Tokens.Base64UrlEncoding.Decode[T](String input, Int32 offset, Int32 length, Func`3 action)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebToken.CreateClaimSet(String rawString, Int32 startIndex, Int32 length, Func`3 action)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebToken.ReadToken(String encodedJson)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.JsonWebTokens.JsonWebToken.ReadToken(String encodedJson)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebToken..ctor(String jwtEncodedString)
at Microsoft.IdentityModel.JsonWebTokens.JsonWebTokenHandler.ReadToken(String token, TokenValidationParameters validationParameters)
--- End of inner exception stack trace ---
Als Lösung hat geholfen
System.IdentityModel.Tokens.Jwt zu installieren.
index.html anzeigbar machen
Nun, ich habe gerade den RouteConfig.RegisterRoutes(RouteTable.Routes); -Aufruf in Global.asax.cs Entfernt und nun wird jede URL, die ich eingebe, wenn die Ressource existiert, bedient. Sogar die API-Hilfeseiten funktionieren noch.
c# get parameter slash erlauben
Um einen slash als parameter zu akzeptieren gibt es die Möglichkeit ihn als letzten Parameter mit {*paramname} anzugeben.
[HttpGet, Route("formular/{*data?}")]
public System.Net.Http.HttpResponseMessage Formular(string data = null)
würde data als optionalen Parameter auch Daten wie asdfasdf/asdfasdf annehmen.
I know you can apply a wildcard in the route attribute to allow / such as date input for example:
[Route("orders/{*orderdate}")]
using of Regex
using System.Text.RegularExpressions;
danach können Sie die folgenden verwenden:
string value = Regex.Replace(<yourString>, "[A-Za-z ]", "");
Logging Database
this.dbconnect.Database.Log = s => log.Debug(s); vor der Abfrage schreiben.
trim strings beim deserialisieren von Classen
https://itecnote.com/tecnote/c-deserialize-json-with-auto-trimming-strings/
Achtung – nur über Strings schreiben, da sonstige Objekte ohne weitere darauf hinweisende Fehler null werden.
jsonconvert DateTimeFormat to Iso
JsonConvert.SerializeObject(pd, new IsoDateTimeConverter() { DateTimeFormat = "yyyy-MM-ddTHH:mm:ss" })
https://stackoverflow.com/questions/42811410/how-to-get-json-net-to-serialize-date-time-to-iso-8601
Speech-Veröffentlichungsproblem
So fortunately the ApplicationPoolIdentity can have similar login magic applied by opening „Advanced Settings“ for the app pool in IIS and setting Load User Profile to True.
Dann geht es .
gefunden in:
und wenn man die Sprache wechseln will muss die Identity auf LocalSystem stehen – Unglaublich
zusätzlich muss die Identität auf LocalSystem stehen
audio in iis aktivieren
System.Speech throws “No voice installed on the system or none available with the current security setting” exception in Windows Service
Long time reader, first time poster. I'm developing a Windows Service in C# .Net 3.5 to perform Text to Speech operations. I'm using System.Speech (Microsoft Speech API 3.x). I deployed the service to a Win2008 x64 server and it's now throwing the following exception: System.InvalidOperationException: No voice installed on the system or none available with the current security setting. at System.Speech.Internal.Synthesis.VoiceSynthesis.Speak(Prompt prompt) at System.Speech.Synthesis.SpeechSynthesizer.Speak(Prompt prompt) at System.Speech.Synthesis.SpeechSynthesizer.Speak(String textToSpeak) The service is running under a domain account. If I change the service to run under my own personal domain account (which has pretty high privileges), everything works perfectly (so a voice [Anna] is definitely installed). So I'm quite certain it's a security issue. What permissions/modifications do I need to make to the other domain account to make this work? And it needs to be this specific user because it's used for Windows auth for a MSSQL database. Thanks in advance.
Simple fix: Grant read/write access to C:\windows\system32\config\systemprofile\appdata\roaming for the same user that the service is running under.
In x64 OS, this is caused by AnyCPU build configuration. Switch to x86 build configuration and it should work.
i exited Visual Studio and reopened it after it saved, and the problem was solved.