none
WCF Service and MSAccess 32 vs MSAccess 64: How to add a service reference? RRS feed

  • Question

  • I need my WCF/MSMQ Service to make records in an MSAccess database. After some bing searching I discovered the problem was that my developer machine had MSOffice 32 and WCF wanted MSAccess 64 (by default). I learned that while I could solve the problem by downloading the MSAccess 64 bit drivers, this would muck up my MS Office on my developer machine... Oops!

    So I fiddled around and discovered that if I change the platform target from ANY CPU to x86 on the properties page for my WCF Service, it works with my little C# main program host for my WCF service.

    It does not work (any more) for the default debug client WCFTestClient.exe, unfortunately.

    Now if I want to update my WCF interface and import the interface into my clients, I normally just run the WCFTestClient by default and start another instance of visual studio for the WCF client project and add a service reference and everything is fine.

    But this does not work any more because I changed the WCF service target platform from ANY CPU to x86.

    What can I do so I can add a service reference to update my clients with the new function arguments in my WCF interface?

    I suppose I could comment out the code to manipulate the MSAccess 32 database, change the target platform back to ANY CPU, recompile, run the WCFTestClient and then add a reference in my client and then change it all back again.

    Ugh!

    Is there an easier way? I hope so!

    Thanks

    Siegfried


    siegfried heintze

    Thursday, April 13, 2017 4:56 PM

Answers

  • CorFlags.exe is automatically installed with Visual Studio. At my side, it is located under C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools.

    I suggest you try Developer Command Prompt for VS XXXX from Start menu.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by siegfried_ Thursday, April 20, 2017 6:53 PM
    Thursday, April 20, 2017 2:56 AM

All replies

  • >>It does not work (any more) for the default debug client WCFTestClient.exe

    What is your OS version? Where is your WCFTestClient.exe? I made a test with below steps, it works correctly.

    1.        Create a Dll which target to x86
    2.        Create a new WCF Service, add dll to this service, and change WCF target to x86
    3.        Set WCF as startup project, and press F5 to debug
    4.        WCFTestClient works correctly

    I suggest you follow above steps to make a test.

    In addition, the link below might be useful to you.

    #Debugging a WCF Service Using a 32 Bit Dll

    https://coding.abel.nu/2012/04/debugging-a-wcf-service-using-a-32-bit-dll/

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 14, 2017 2:17 AM
  • I start with my favorite example and compile the NoSecurityService in VS 2015 R3 on Windows 10:

    CodeProject Simple WCF/MSMQ Example

    I run VS2015 in administrator mode for the sln file and edit the App.config to change the computer name and hit F5 and VS launches the debug client with the little GUI. This works.

    Now, on project properties I change the platform target to x86 and hit F5 again:

    Error message window

    I'm confused. Earlier this morning I clicked OK on the debug dialog above and got the GUI dialog box for WcfTestClient.exe with red "X" error icons next to my Interface functions. Now, I get nothing.

    In any case, I can no longer run separate additional sessions  of VS2015 for my clients and add a service reference or update an existing reference.

    Now my WCF/MSMQ Service and WCF/MSMQ clients still run fine (if I ignore a few error messages) with the server platform in x86 mode. I just cannot update my service references after adding additional function parameters.

    Let me know if you can reproduce my behavior.

    Thanks

    Siegfried


    siegfried heintze

    Friday, April 14, 2017 11:55 PM
  • I could reproduce your issue, and I suggest you refer the link in my first reply to generate WcfSvcHost32.exe.

    Then, you could use WcfSvcHost32.exe by Debug->Start project->Start external program, and set the command line arguments like below:

    /service:MSMQNoSecurityService.dll /config:MSMQNoSecurityService.dll.config /client:"WcfTestClient.exe"



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 17, 2017 5:18 AM
  • Sorry, I need some more help. In the directions same link as above: debugging-a-wcf-service-using-a-32-bit-dll he copies WcfSvcHost.exe to WcfSvcHost32 and then runs corflags.

    However, I cannot find corflags.exe.

    It is not anywhere in my c:\Program Files* directory tree and I have the SDKs for Windows 8 and Windows 10 installed.

    Thanks

    Siegfried

     

    siegfried heintze

    Wednesday, April 19, 2017 9:42 PM
  • CorFlags.exe is automatically installed with Visual Studio. At my side, it is located under C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools.

    I suggest you try Developer Command Prompt for VS XXXX from Start menu.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by siegfried_ Thursday, April 20, 2017 6:53 PM
    Thursday, April 20, 2017 2:56 AM
  • Thank you very much. It was a little confusing that the WCFSvcHost32.exe GUI did not show the details of the WCF interface like it did previously in the 64 bit version.

    However, I was able to fire up VS on my client and import and it did seem to work. What a surprising resolution! I would never have thought I could convert a 64 bit to a 32 bit image!

    Siegfried


    siegfried heintze

    Thursday, April 20, 2017 6:57 PM
  • >> the WCFSvcHost32.exe GUI did not show the details of the WCF interface like it did previously in the 64 bit version

    Did you set below command line arguments by opening project property Debug->Start project->Start external program

    /service:MSMQNoSecurityService.dll /config:MSMQNoSecurityService.dll.config /client:"WcfTestClient.exe"

    It will make GUI show the WCF Interface.

    If you have trouble to show WCF Service in WCFSvcHost32.exe, I will suggest you post a new thread, and then we could focus on this specific issue.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 21, 2017 2:44 AM