| Author |
Message |
Guest
|
Posted:
Tue May 10, 2005 10:23 pm Post subject:
Help !! Server.CreatePlaylist ERRORS !!!! |
|
|
I am using windows media services to program playlists.When i use the
code below and also add reference for
interop_msxml.dll (added to bin directory) , i get this error .I have
tried everything but failed to compile.
I would really appreciate any help or if you could shed some light on
this.
Basically it bails out when i use Server.CreatePlaylist and gives the
error below.
Thanks,
********
ERROR
Error 1 The type 'interop_msxml.IXMLDOMDocument' is defined in an
assembly that is not referenced. You must add a reference to assembly
'interop_msxml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'. C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\WebSites\WebSite4\Default.aspx.cs 25 13
*********
AM I MISSING SOMETHING ??? REFERENCE ASSEMBLY ???
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;
using System.Xml;
using System.Runtime.InteropServices;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Declare variable.
WMSServer Server;
try
{
// Create a new WMSServer object.
Server = new WMSServerClass();
IXMLDOMDocument oXml = Server.CreatePlaylist();
}
catch (COMException comExc)
{
// TODO: Handle COM exceptions.
}
}
}
|
|
| Back to top |
|
 |
art rodkin
Guest
|
Posted:
Thu May 12, 2005 12:30 am Post subject:
Re: Help !! Server.CreatePlaylist ERRORS !!!! |
|
|
I am having the same problem. And I did add the interop_msxml.dll as
reference to the project...Hopefully someone has the solution for
this...
nsrinivas@gmail.com wrote:
| Quote: | I am using windows media services to program playlists.When i use the
code below and also add reference for
interop_msxml.dll (added to bin directory) , i get this error .I have
tried everything but failed to compile.
I would really appreciate any help or if you could shed some light on
this.
Basically it bails out when i use Server.CreatePlaylist and gives the
error below.
Thanks,
********
ERROR
Error 1 The type 'interop_msxml.IXMLDOMDocument' is defined in an
assembly that is not referenced. You must add a reference to assembly
'interop_msxml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'. C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2005\WebSites\WebSite4\Default.aspx.cs 25 13
*********
AM I MISSING SOMETHING ??? REFERENCE ASSEMBLY ???
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;
using System.Xml;
using System.Runtime.InteropServices;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// Declare variable.
WMSServer Server;
try
{
// Create a new WMSServer object.
Server = new WMSServerClass();
IXMLDOMDocument oXml = Server.CreatePlaylist();
}
catch (COMException comExc)
{
// TODO: Handle COM exceptions.
}
}
} |
|
|
| Back to top |
|
 |
art rodkin
Guest
|
Posted:
Thu May 12, 2005 11:06 pm Post subject:
Re: Help !! Server.CreatePlaylist ERRORS !!!! |
|
|
i think i figured it out...I am not sure whether I am going to run into
any problem in a long run because of my solution, but here is what I
did:
The interop_msxml.dll file that comes with the platform SDK is version
9, the compiler is looking for version 2
So - I downloaded version 2 from http://dll.webzila.com and added it as
reference to my project and it compiled.
The concept of assemblies is still a little bit of a new ground to me
(as well as .net) - I don;t understand why it is looking for a
particular version, but for now I guess I am just happy it's working.
|
|
| Back to top |
|
 |
WashingtonBR
Joined: 03 Nov 2005
Posts: 2
Location: Brasil - Sao Paulo
|
Posted:
Sun Nov 06, 2005 5:43 am Post subject:
re:Help !! Server.CreatePlaylist ERRORS !!!! |
|
|
Hi All,
Art Rodkin your solution really compile, but look the following combinations:
1-(Server WMS 9.1 (Win2K3 SP1) + (PIA)Microsoft.WindowsMediaServices.dll 9.0.0.1(file version 9.0.0.3693) + interop_msxml 2.0.0.0)
In this case some things do not work correctly. Exceptions occur when working with playlists.
2-(Server WMS 9.1 (Win2K3 SP1) + (PIA)Microsoft.WindowsMediaServices.dll 9.0.0.0(file version 9.0.0.3665) + interop_msxml 2.0.0.0)
In this case work correctly. You only lose some new features that exist in WMS 9.1.
3-(Server WMS 9.0 (Win2K3 without SP1) + (PIA)Microsoft.WindowsMediaServices.dll 9.0.0.0(file version 9.0.0.3665) + interop_msxml 2.0.0.0)
No problems.
4-(Server WMS 9.1 (Win2K3 SP1) + (PIA)Microsoft.WindowsMediaServices.dll 9.0.0.1(file version 9.0.0.3693) + interop_msxml 9.0.0.3693)
In this case you have a compiler error, because the manifest inside the PIA reference the old version and the public key of interop_msxml 2.0.0.0. The new version comes without a public key, so a bindRedirect is difficult.
While Microsoft does not decide this headache, there is a workaround that work:
1- Use ILDasm to generate MSIL source code for the assembly Microsoft.WindowsMediaServices.dll 9.0.0.1(file version 9.0.0.3693):
| Code: |
ildasm microsoft.windowsmediaservices.dll /out=microsoft.windowsmediaservices2.il |
2- Modify the MSIL code with Visual Studio or other editor. Now you need to be aware in what you can do. In the beginning of IL you will see the
manifest, look the second external referenced assembly:
| Code: |
.assembly extern interop_msxml
{
.publickeytoken = (31 BF 38 56 AD 36 4E 35 ) // 1.8V.6N5
.ver 2:0:0:0
}
.assembly Microsoft.WindowsMediaServices
{
|
3- Modify the lines above to look as follows:
| Code: |
.assembly extern interop_msxml
{
.ver 9:0:0:3693
}
.assembly Microsoft.WindowsMediaServices2 //Note the change in this line too
{
|
4- A little more below, in the IL exist the section where are the declarations of the public key and the attribute that defines this assembly
as a primary interop assembly:
| Code: |
.custom instance void [mscorlib]System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute::.ctor(int32,
int32) = ( 01 00 09 00 00 00 00 00 00 00 00 00 )
.publickey = (00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 // .$..............
00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 // .$..RSA1........
B5 FC 90 E7 02 7F 67 87 1E 77 3A 8F DE 89 38 C8 // ......g..w:...8.
1D D4 02 BA 65 B9 20 1D 60 59 3E 96 C4 92 65 1E // ....e. .`Y>...e.
88 9C C1 3F 14 15 EB B5 3F AC 11 31 AE 0B D3 33 // ...?....?..1...3
C5 EE 60 21 67 2D 97 18 EA 31 A8 AE BD 0D A0 07 // ..`!g-...1......
2F 25 D8 7D BA 6F C9 0F FD 59 8E D4 DA 35 E4 4C // /%.}.o...Y...5.L
39 8C 45 43 07 E8 E3 3B 84 26 14 3D AE C9 F5 96 // 9.EC...;.&.=....
83 6F 97 C8 F7 47 50 E5 97 5C 64 E2 18 9F 45 DE // .o...GP..\d...E.
F4 6B 2A 2B 12 47 AD C3 65 2B F5 C3 08 05 5D A9 ) // .k*+.G..e+....].
.hash algorithm 0x00008004
.ver 9:0:0:1
} |
5- Remove all the lines starting from ".custom instance void
[mscorlib] System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute..." , leaving only the last three lines of the section showed above as below:
| Code: |
.hash algorithm 0x00008004
.ver 9:0:0:1
}
|
6- Now you have an IL that is no more strong named and no more is a PIA.
Using your editor replace feature, change all the text occurrences of
"Microsoft.WindowsMediaServices.Interop" to
"Microsoft.WindowsMediaServices2.Interop2". It begins on the first occurrence
of ".namespace Microsoft......."
7- Save your work and Recompile the MSIL using the ILASM compiler:
| Code: |
ILAsm /dll /resource=microsoft.windowsmediaservices2.res microsoft.windowsmediaservices2.il
|
OK, if you did all things right, now you have a new assembly with a new
namespace that will not conflict with the official version and that can work
with interop_msxml version 9.0.0.3693 assembly.
Good lucky..
Washington Moreira |
|
| Back to top |
|
 |
|
|
|
|