0

I'm currently getting to know SOAP and I've created a simple WCF project with a couple of methods which I wanted to test through HTMl/JS.

I ran into a CORS-issue and tried to enable CORS using this resource but I've still got an issue loading the behaviorextension.

The behaviorextensionelement I added could first not be recognized in the Web.config, I fixed this by implementing this solution but when launching the service I still get the System.Configuration.ConfigurationErrorsException: The type 'AttemptAtSOAP.EnableCrossOriginResourceSharingBehavior, AttemptAtSOAP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null ' registered for extension 'crossOriginResourceSharingBehavior' could not be loaded.

I believe my mistake is within the "type"-field here but I'm not sure what it should be

<extensions>
          <behaviorExtensions>
              <!--error seems to be within the "type"-field-->
              <add name="crossOriginResourceSharingBehavior" type="AttemptAtSOAP.EnableCrossOriginResourceSharingBehavior, AttemptAtSOAP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
          </behaviorExtensions>
      </extensions>

The layout of my project is currently this:

project layout

I noticed the suggestion here mentioned setting the type to the reference of your DLL, but I don't have one so that might be a first mistake...

Let me know if I need to provide some more info or if you have a clue, cheers!

  • You may refer to [the case](https://stackoverflow.com/questions/6759977/wcf-unable-to-load-custom-behavior-extension-from-strongly-named-assembly) for more help. – Jiayao Feb 28 '23 at 09:51
  • @Jiayao thanks for the suggestion, however as I don't have a DLL there's no logs showing anything happening. I have however abandoned the idea of creating a WCF service and instead will make one in .NET core, but for future reference, this does not solve my problem. – Arno Vantieghem Mar 02 '23 at 15:46

0 Answers0