Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding a WCF Service to a project
    primarykey
    data
    text
    <p>I have a C# WinForms Project which contains some WCF service definition files which I have created in the project by adding standard classes (not using Add Item > WCF Service).</p> <p>The project contains some dependencies that require me to build the project for x86 processors.</p> <p>If I edit the app.config file with the WCF Service Configuration Editor and try to use the "Create New Service ..." wizard, and then browse to the project EXE file (in the debug folder) I get an error, (which I've read is because I'm targeting the x86 processor):</p> <p><code>Could not load file or assembly 'EXE_FILE_NAME' or one of its dependencies. An attempt was made to load a program with an incorrect format.</code></p> <p>So, upon changing the target to All CPUs, compiling the project again, and then trying to create the service in the WCF Service Configuration Editor again, I now get a different error:</p> <p><code>Could not load file or assembly 'SOLUTION_NAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</code></p> <p>(To clarify, I CAN still compile the project when targeting all CPUs, but get an error at runtime due to a dependency)</p> <p>Is anybody able to help me with this problem, so I can add the services defined in app.config file using the wizards in WCF Service Configuration Editor? (I think that if I add the services to the WCF Service Configuration Editor when targeting All CPUs I can make any modifications thereafter, regardless of the target)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COIt sounds like you are trying to interact with a WCF service but aren't using the "Add Service Reference" dialog. Is this correct? If so, why aren't you using the built-in tools to do so?
      singulars
    2. COYes, I am not using the "Add Service Reference". I'm have the service defined in the WinForms project, but I have copied the code in from another project (I don't want them linked). But when I try to configure the WCF Service with the 'WCF Service Configuration Editor' (it's in the context menu when you right-click the app.config file) the services aren't available for configuration. So I'm trying to add them using the wizard in the WCF Editor. I'm not trying to reference a service in another project.
      singulars
    3. COSo, if I understand you correctly, you are adding the WCF service projects (the actual code, project file, etc.) to your new solution. While it may not be strictly relevant, why would you do this? The point of a WCF service (and OO in general) is that you would design it once and deploy it for all to use. It seems like you are creating a headache for yourself in order to do something that doesn't make sense to me. If you have a good reason (I'm sure there could be one), don't bother trying to justify it to me, just tell me "yep, we thought about it" and it will be good enough.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload