Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use iCal.Net 3.0.13 with .NET Framework application #324

Closed
xkxtnt opened this issue Oct 19, 2017 · 7 comments
Closed

Can't use iCal.Net 3.0.13 with .NET Framework application #324

xkxtnt opened this issue Oct 19, 2017 · 7 comments
Labels

Comments

@xkxtnt
Copy link

xkxtnt commented Oct 19, 2017

Hi All,
I am new to Ical.Net and installed version 3.0.13 on VS Community 2015. Just trying to test it out and got this error (the console project target .NET 4.6.2).

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Playground.exe
Additional information: Could not load file or assembly 'System.Runtime.Serialization.Primitives, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I am just testing one line of code:
Calendar cal = new Calendar();

What could be the issue?

Thanks a lot!

@rianjs
Copy link
Collaborator

rianjs commented Oct 19, 2017

Thanks for the report. I was able to replicate the problem as well. I haven't done much testing between framework applications and v3 which is a .NET Standard (1.3) implementation, as most of our stuff still uses v2.

The fix appears to be adding System.Runtime.Serialization.Primitives to the nuspec list of dependencies for v3. I did that, and published a new version to nuget (3.0.14) and retried it locally without issue.

I'll close this up for now, if the fix is incomplete, just re-open.

https://www.nuget.org/packages/Ical.Net/3.0.14

@rianjs rianjs closed this as completed Oct 19, 2017
@rianjs rianjs changed the title Can't use iCal.Net 3.0.13. Can't use iCal.Net 3.0.13 with .NET Framework application Oct 19, 2017
@xkxtnt
Copy link
Author

xkxtnt commented Oct 20, 2017

Thanks! That solved it. Now I just need to find some documentation on how to use it, from the basic. The Wiki page doesn't seem that useful for a newbie. :)

@rianjs
Copy link
Collaborator

rianjs commented Oct 20, 2017

What are you trying to do?

@xkxtnt
Copy link
Author

xkxtnt commented Oct 21, 2017

I am trying to send a all day meeting event invite with an alarm set for a day before the event day.
I tested with the function below that uses static string and was able to get almost everything I needed. But I tried to replicate it using iCAL.net and it just won't work. Ideally, I will want to be able to attach some PDF files to the invite.

   public static void SendEmailString()
    {
        MailMessage msg = new MailMessage();
        msg.From = new MailAddress("john.smith@company.com", "Company Inquiry");
        msg.To.Add(new MailAddress("john.smith@company.com", "John Smith"));
        msg.Subject = "CS Inquiry";
        msg.Body = "TESTING";

        string test = @"BEGIN:VCALENDAR

PRODID:-//company & Ellis//Company Inquiry//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;CN=""Smith, Jog"";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:john.smith@company.com
ATTENDEE;CN=""dae, Kevin"";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:kevin.dae@company.com
ORGANIZER: Company Inquiry Team
DTSTART:20171022T040000Z
DTEND:20171023T040000Z
LOCATION:New York
TRANSP:TRANSPARENT
SEQUENCE:0
UID: 56e32030-0bbf-4911-96767449-537hjff
DTSTAMP:20171020T004739Z
DESCRIPTION:Auto Generated Meeting Invite, please discard.
SUMMARY:Auto Generated Meeting Invite, please discard.
PRIORITY: 5
CLASS: PUBLIC
BEGIN:VALARM
TRIGGER:-PT1440M
ACTION:DISPLAY
DESCRIPTION:REMINDER
END:VALARM
END:VEVENT
END:VCALENDAR";

        SmtpClient sc = new SmtpClient("smtp.company.com");

        System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType("text/calendar");
        ct.Parameters.Add("method", "REQUEST");
        AlternateView avCal = AlternateView.CreateAlternateViewFromString(test, ct);
        msg.AlternateViews.Add(avCal);

        sc.Send(msg);

    }

@rianjs
Copy link
Collaborator

rianjs commented Oct 21, 2017

Please post the question on stackoverflow and link it here. And if you’re having problems with ical.net, please post some sample code showing what you tried.

@xkxtnt
Copy link
Author

xkxtnt commented Oct 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants