我正在使用 Rustici Scorm Cloud API 生成一个 URL 来预览一些学习材料:
- API 文档:buildCoursePreviewLaunchLink
- NuGet 包:1.0.0
该代码创建了一个填充了字符串字段的LaunchLinkRequestSchemaRedirectOnExitUrl
对象。但是,我在实例化时收到了 InvalidDataException:
代码
var l = new LaunchLinkRequestSchema()
{
RedirectOnExitUrl = "https://www.example.com"
};
例外
System.IO.InvalidDataException HResult=0x80131501
Message=RedirectOnExitUrl is a required property for LaunchLinkRequestSchema and cannot be null
Source=Com.RusticiSoftware.Cloud.V2
StackTrace:
at Com.RusticiSoftware.Cloud.V2.Model.LaunchLinkRequestSchema..ctor(Nullable`1 Expiry, String RedirectOnExitUrl, Nullable`1 Tracking, String StartSco, String Culture, String CssUrl, List`1 LearnerTags, List`1 CourseTags, List`1 RegistrationTags, List`1 Additionalvalues)
at ScormAPI_Tests.Program.Main() in
C:\...\Program.cs:line 26
我不明白为什么在给属性赋值时会看到此错误。谁能解释一下这里发生了什么?