Failed parsing the policy document

I am using WSE 3.0 with VS 2005 pro. I created a ASP .NET web service project on the local file system, added MyAssertion.cs to the App_Code folder in the project. After I manually added extension element to the wse3policyCache.config file. I get an error when I try to open the WSE setting 3.0. The following is the extension element I added and the error message that I got.

extension element
==============
<extension name="MyAssertion" type="MyAssertion, App_Code" />

Error Message
===========
---------------------------
WSE Security Settings Tool
---------------------------
Failed parsing the policy document.  Could not load file or assembly 'App_Code' or one of its dependencies. The system cannot find the file specified.


Note:
I tried to open the WSE 3.0 Setting on the SecureInvoiceClient project in the Part2_After solution in the WSE 3.0 hands on Lab - security\CS\Advenaced, and get the same error message.


Answer this question

Failed parsing the policy document

  • Artem V

    Check that the assembly you are using is App_Code and it seems that your assertion is not in that assembly. Try placing the assertion in a separated assembly and reference the assembly from the Web Application project. And, of course, change the type attribute with the correct assembly name.

  • rgerbig

    The assembly name is correct because the web service can load the assertion. It is just the WSE Settings 3.0 tool can not parse the wse3policyCache.config once you add the custom assertion. I think it is the bug in WSE Settings 3.0 tool. Does anyone has the similar problem
  • sulphox

    Well, yes, I have the same problem: Failed parsing the policy document. Could not load file or assembly ... or one of its dependencies. File not found.

    In the wse3policyCache.config:
    < xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    <policies xmlns="http://schemas.microsoft.com/wse/2005/06/policy">

       <extensions>

          <extension name="usernameAssertion" type="Framework20.Webservices.Wse.UsernameServiceAssertion, Framework20.Webservices" />

          <extension name="traceContextFilterAssertion" type="Framework20.Webservices.Wse.TraceContextPolicyAssertion, Framework20.Webservices"/>

       </extensions>

       <policy name="ServerPolicy">

          <usernameAssertion/>

          <traceContextFilterAssertion/>

       </policy>

    </policies>

    where the project have references to the Framework20.Webservices.dll - I can create the instances in cs-files in the project but somehow WSE 3.0 cannot find the file (or one of its dependencies). .

    The dll is not registered in GAC and all dependencies seems to be present.

    Regards,
    Peter


  • scott13

    Not an answer but an insult.

  • Joaquin Raya

    I am not sure someone answered this ..in the file prop settings "Copy to output" --> Always

  • Peter Huang --- MSFT

    The WSE 3.0 setting tool cannot parse your custom policy as it has no understanding of its meaning. This is by design. You are still able to use the WSE 3.0 settings tools to configure other settings on your application.

    The policy tool is designed to generate the built in policy assertions. When you add custom policies assertions you are on your own, although the syntax is straightforward.

    Thanks. Mark



  • Helloimbob

    I have run across exactly the same problem. Are there any known solutions I use a custom policy to pass the username/password for a web service. This is part of a windows .net 2.0 application that uses a setup deployment project. I also found it interesting that when deployed, this file is not found on the target machine:

    wse3policyCache.config


  • Failed parsing the policy document