Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:45:43+00:00 2026-06-17T05:45:43+00:00

I am trying to create a multimedia component in Tridion templating classs with the

  • 0

I am trying to create a multimedia component in Tridion templating classs with the below code.

MemoryStream stringInMemoryStream = new MemoryStream(ASCIIEncoding.Default.GetBytes("
<test>testing</test>"));                            
Component xmlMultimediaComponent = new Component(engine.GetSession(), new 
  TcmUri("tcm:21-2008-2"));                
xmlMultimediaComponent.Title = "New MM component";
xmlMultimediaComponent.Schema = new Schema(new TcmUri("tcm:10-6532-8"), 
 engine.GetSession());                
xmlMultimediaComponent.BinaryContent.MultimediaType = new MultimediaType(new 
   TcmUri("tcm:0-36-65544"), engine.GetSession());                                         
xmlMultimediaComponent.BinaryContent.MultimediaType.MimeType = "application/xml";
xmlMultimediaComponent.BinaryContent.MultimediaType.FileExtensions = new List<string> 
   {"xml", "XML"};
xmlMultimediaComponent.BinaryContent.UploadFromStream = stringInMemoryStream;
xmlMultimediaComponent.BinaryContent.Filename = "testing.xml".ToLower();                                    
xmlMultimediaComponent.Save();                
xmlMultimediaComponent.CheckIn(true);

Note that “tcm:21-2008-2” is folder TCM ID in which the component has to be created.
The “tcm:10-6532-8” is the Multimedia schema ID and “tcm:0-36-65544” is the multimedia type ID.

However there seems to some issue and it is failing with below error:

Link to Schema has invalid value.
at Tridion.ContentManager.Utilities.ThrowInvalidLinkException(Link link, KernelException innerException)
at Tridion.ContentManager.IdentifiableObject.AssertValidLink(Link link)
at Tridion.ContentManager.IdentifiableObject.AssertValidLinks(IEnumerable`1 links)
at Tridion.ContentManager.IdentifiableObject.AssertValidLinks()
at Tridion.ContentManager.IdentifiableObject.OnSaving(SaveEventArgs eventArgs)
at Tridion.ContentManager.ContentManagement.RepositoryLocalObject.OnSaving(SaveEventArgs eventArgs)
at Tridion.ContentManager.ContentManagement.VersionedItem.OnSaving(SaveEventArgs eventArgs)
at Tridion.ContentManager.ContentManagement.Component.OnSaving(SaveEventArgs eventArgs)
at Tridion.ContentManager.IdentifiableObject.Save(SaveEventArgs eventArgs)
at Tridion.ContentManager.ContentManagement.VersionedItem.Save(Boolean checkInAfterSave)
at Tridion.ContentManager.ContentManagement.VersionedItem.Save()

The above error is occuring at below statement xmlMultimediaComponent.Save().

Any idea how can we pass LinkToMultimedia type schema id to Multimedia component?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:45:44+00:00Added an answer on June 17, 2026 at 5:45 am

    I think the schema ID must contain the context publication ID, so in this case 10-6532-8 should be 21-6532-8.

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create a new Dedicated Cache Role in Windows Azure but get the
I have been trying to create a new content type for Plone based on
I was trying create an array of a collection as follows. ArrayList<Integer> ar[]=new ArrayList<Integer>[50];
I am trying create a xmldocument object by a different XML see the code
I am new to asp.net & trying create a object, but there is a
I trying create empty white image with php, this s my code $bg =
I am trying create a new css for shaping my detailsview. But i couldn't
I am trying create a new frame in wxPython that is a child of
I'm trying create new object from a module class in VBA, and I have
I'm trying create a composite component to use across my projects, so, I've created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.