Comments (7)
Thanks for reporting this and for the additional information. I'll look into it this weekend and report back what I find.
from stronggrid.
I still can't explain why this problem is occurring, but I can confirm that I am able to reproduce it when I create a new .net7 console app and reference the latest StrongGrid package from NuGet (which, by the way, targets .net5 and .net6). Is the problem related to some quirk when referencing a .net6 library from a .net7 project?
Maybe this is an argument in favor of expediting #463?
So far, I already faced (and fixed) one serialization problem caused by a change introduced in .net7 (explanation here, I fixed it here). This might be another similar situation.
I'm continuing my research...
from stronggrid.
I found the culprit and I know how to fix the issue, but I still can't explain why this problem occurs only when our library targets .net6 and it's used in a .net7 application.
An update should be available on NuGet tomorrow.
from stronggrid.
FWIW, this little bit in Program.cs
reproduces the problem. It seems to be the MailPersonalization.CustomArguments
that is the issue - comment that stuff out and it'll work without an error:
using StrongGrid;
using StrongGrid.Models;
using MailAddress = StrongGrid.Models.MailAddress;
const string sendGridKey = "your sendgrid key";
Console.WriteLine("Sending email...");
var client = new Client(sendGridKey);
var personalization = new MailPersonalization
{
To = new[] { new MailAddress("[email protected]", "Ken Smith") },
CustomArguments = new KeyValuePair<string, string>[]
{
new ("PolicyNumber", "some policy number"),
new ("PolicyHolder", "some email address"),
},
};
var contents = new List<MailContent>
{
new("text/plain", "Hello plain world!"),
};
var result = await client.Mail.SendAsync(new List<MailPersonalization> { personalization },
"Test Subject",
contents,
new MailAddress("[email protected]", "Ken Smith"),
new List<MailAddress> { new("[email protected]", "Ken Smith") }
);
Console.WriteLine($"Sent email: {result}");
Console.ReadLine();
from stronggrid.
🎉 This issue has been resolved in version 0.95.1 🎉
The release is available on:
Your GitReleaseManager bot 📦🚀
from stronggrid.
I found the culprit and I know how to fix the issue, but I still can't explain why this problem occurs only when our library targets .net6 and it's used in a .net7 application.
An update should be available on NuGet tomorrow.
Thank you so much! I tested out the update in our solution, and it's resolved the problem.
from stronggrid.
Excellent! Thank you for confirming.
from stronggrid.
Related Issues (20)
- Mark the LegacyCLient as obsolete HOT 1
- Remove obsolete members
- InternalMessageId on webhook Events not always being returned with .filter in the value HOT 6
- Rename the `Client` class
- `IpAddress.AssignedOn` can be null HOT 2
- Access modifier issue in SingleSend model HOT 3
- Vulnerabilities Detected HOT 13
- `The JSON value is not in a supported DateTime format` when searching for contacts HOT 1
- Improve the WebhookSettings resource to handle multiple webhook settings HOT 1
- Unable to create new Webhook settings HOT 1
- Unable to configure Oauth when updating an existing Webhokk settings HOT 1
- Improve logging template/scopes, or provide a logging delegate? HOT 5
- Unable to configure Oauth when testing webhooks HOT 1
- Unable to toggle signature verification for a event webhook HOT 1
- Unable to specify the Id of the desired event webhook settings when retrieving the public key HOT 1
- Missing method to delete an existing event webhook settings HOT 1
- Use .net8 HostedApplication to run integration tests HOT 1
- Further improve how we handle unsupported encodings when parsing InboundEmail webhooks HOT 1
- .NET 8 JsonException when trying to parse inbound email HOT 5
- Incorrect diagnostic log in error handler HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stronggrid.