Additional Assemblies Media Center Plugin

269 Views Asked by At

I am trying to write a Windows Media Center Plugin for the first time.

The plugin is going to make use of an external assembly zeroconfignetservices. I built the project everything compiles correctly. However, when I run the application in media center the following error appears in the Event Viewer.

Exception System.IO.FileNotFoundException: Could not load file or assembly 'ZeroconfService, Version=0.6.0.0, Culture=neutral, PublicKeyToken=1df4e21661f2383d' or one of its dependencies. The system cannot find the file specified.

But the assembly is loaded in the GAC. Output of gacutil /l zeroconfservice:

Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.17929
Copyright (c) Microsoft Corporation.  All rights reserved.

The Global Assembly Cache contains the following assemblies:
zeroconfservice, Version=0.6.0.0, Culture=neutral, PublicKeyToken=1df4e21661f2
383d, processorArchitecture=x86

Number of items = 1

I also tried putting a copy of the ZeroconfService.dll in the same directory as the media center plugin.

What else do I need to do to make the media center plugin see the assembly?

To be thorough there was one warning when compiling the code. I am not a .Net developer typically and do not understand the nuance of the warning. Perhaps this is related?

warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ZeroconfService", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
2

There are 2 best solutions below

0
On

I was having this same error and I was about to give up. The solution that I had found was that all the instructions provided by the Windows Media Center SDK very explicitly say to build it for x86. The solution was to change that to x64. As a note I am running a windows 7 64bit processor.

1
On

Make sure that your plugin project is targeting x86. Your managed project is probably JIT'ing to 64 bit code, which would cause the framework to look for a 64 bit assembly. In Visual Studio 2012 this under Project Properties->Build->Platform Target

-Project Properties Screenshot>