peschuster

Technology, .NET and Web

  • Info

Interop

Interop type ‘iTunesAppClass’ cannot be embedded.

June 7, 2012 by peter

iTunes comes with an api you can access from any (.NET) program by adding the COM reference “iTunes 1.xx Type Library” (see iTunes COM for Windows SDK) to your Visual Studio project:

using iTunesLib;
iTunesApp app = new iTunesAppClass();

When trying to instantiate an ‘iTunesAppClass’ object the compiler initially outputs the following error message, although creating an instance of this class is the only way to access iTunes:

“Interop type ‘iTunesLib.iTunesAppClass’ cannot be embedded. Use the applicable interface instead.”

 

This is due to a setting in the reference properties:

  1. Go to the Solution Explorer.
  2. Right click on References –> iTunesLib and hit Properties.
  3. Set “Embed Interop Types” to False.

image

This solves the described error and you can go on automating iTunes.

Remarks: For German localization settings the error message is “Der Interoptyp “iTunesLib.iTunesAppClass” kann nicht eingebettet werden. Verwenden Sie stattdessen die entsprechende Schnittstelle.”

Posted in: .NET Tagged: .NET, Interop, iTunes

Syndication

  • RSS 2.0

Recent Posts

  • Ubiquiti EdgeRouter™ X SFP – Teardown
  • Force HttpWebRequest to IPv4
  • Blackmagic Design ATEM GPI and Tally Interface Teardown
  • WinForms ListView DoubleClick Event for Empty Lists
  • Planning Center Online – Custom Plan Reports in Landscape Orientation

Tags

.NET AntiXssEncoder ASP.NET Build c# Configuration crawler Debugging EF ELMAH Expression tree Graphite Interop IssuerNameRegistry iTunes Linq ListView MVC pco pdf Security SecurityKey SecurityToken simulatebe sql server StatsD STS teardown TYPO3 UAC UI UserSettings Visual Studio WIF WIF in depth WinForms WndProc
profile for Peter at Stack Overflow, Q&A for professional and enthusiast programmers Peter Schuster

Copyright © 2025 peschuster.

Alpha WordPress Theme by themehall.com