FaultException: This message cannot support the operation because it has been read.
-
30 septembrie 2007 19:32Hello Everyone:
I am using Windows Vista as my OS and thus had to install the stocktrader manually. I followed all of the setup instructions, but now I am getting a strange error when I am running the WPF app. When I first go to Config and check IIS Host, then enter in my localhost address and hit "connect", it says failed to connect.
After breaking into VS.net 2005 for this, I noticed that the exception actually says:
"FaultException`1 occured... This message cannot support the operation because it has been read."
It looks like when you click "connect", it tries to do a sample AttemptConnect call to "return this.Channel.getQuote(symbol);" from BusinessServiceClient.cs line 328.
Any ideas on what could be causing this? I can't find any google search results for this problem and have been stuck for quite a while now.
Thanks!!
Toate mesajele
-
30 septembrie 2007 19:50Moderator
You should not need to do a manual install when on Vista. I would try deleting the current install location, deleting your existing IIS virtual directories for TradeServiceWcf, Trade and ConfigWeb, and then running the automated setup again, after making sure all the pre-reqs (listed during automated setup) are installed/configured.
Also make sure you are running SP1 of Visual Studio, with the appropriate updates for Vista from MSDN. Other pre-reqs include making sure you have enabled .NET 3.0 HTTP Activation (through Vista add/remove features panel)...
Most of the time an error like this is due to some pre-req missing--or attempt to run against SQL Express which is not supported.
The readme that pops up at the end of the setup routine has check links for the various services....this should be the first thing to check after running the automated setup; but the automated setup should work on Vista.
-Greg
-
30 septembrie 2007 20:18Well, the reason I did manual, was because I got an IIS "cannot read configuration file" during installation. I just tried uninstalling and am at the same impass. Another MS posted recommended that if you see this error, try doing just a code install:
http://forums.microsoft.com/msdnworkshop/ShowPost.aspx?PostID=1976371&SiteID=64
Is there any way to get around this error and still do a full install?
Thanks a bunch. -
30 septembrie 2007 21:03
So, I have tried once again to do a code install and manually configure because of the iis configuration file error. Here are the steps that I took:
- Did manual code install.
- Configured MSDTC for vista instructions
- Setup .Net 3.0 + Http Activation is setup
- Confirmed IIS and MSMQ are set up
- Confirmed using SQL Server 2005 standard
- Using VS 2005
- Successfully ran the CreateAndLoadDatabase executable
- Set up virtual directories in IIS for ConfigWeb, TradeServiceWcf, and Trade. I then converted them to applications under the defaultAppPool
- I ignored the ServiceModelReg.exe setup instructions since it says this is not necessary for Vista
Not really sure what the best thing to do here is? Do I have to build each project myself in a certain order?
Confused,
-
1 octombrie 2007 15:48ModeratorThe cannot read configuration file on initial install does worry me. I have not seen this error before; nor the
'message cannot support the operation becuase it has been read" issue.
When you install (automated); are you logged in as a local admin on the Vista machine?
Also, try creating two new application pools (integrated pipeline, not classic), and assigning /tradeservicewcf to one and /trade to the other. Turn off all recycling options on the pools (although it should work fine with recycling too).
In general, when I want to do a new build of everything, I build the solutions in this order to ensure projects that reference shared libraries from other solutions pick up the newly built assemblies (for example, when switching to a debug build):
1) Configuration solution
2) Order Processor solution
3) Business Service Solution
4) Trade Web app solution
5) WPF Smart client solution
-Greg
-
1 octombrie 2007 15:55Moderator
Also, some directories have special permissions, and web apps and VS projects should not be placed in them. For example, post build copies will not work in VS for any VS solution installed in the \program files directory. Desktop, and anytjhing under \users directory can have similar issues, due to special restricted permissions placed on these directories by the OS.
I always install the physical files to [drive]:\stocktrader; any newly created directory should work, but avoid \program files and anything under the \users directory on Vista.
-Greg
-
23 ianuarie 2008 19:31
I had the same problem. It appears that the problem is from the VsDebuggerCausalityData header that gets inserted into the soap header. I tried to use:
<
system.diagnostics><
switches><
add name="Remote.Disable" value="1" /></
switches></
system.diagnostics>in app.config but it didn't seem to work as advertised. If I changed my client to Release (from Debug), ran without Debug (ctrl+F5) or ran outside of VS 2008, it worked perfectly.
-dp
-
24 ianuarie 2008 01:33Moderator
Yes, this is an item I will be putting into the upcoming notes, including for implementing config service. Its is very imperative, for a variety of reasons, that you NOT debug within VS debugger host (ala hitting f5 run on your IIS start page), but rather, use Debug menu oin VS to *attach* directly to the real process (for example, the w3p.exe worker process that equates to your app pool). In this way, especially in multi-machine/remote setups (and for this specific issue), we are debugging the real thing, with notifications from other machines, etc.
-Greg
-
14 august 2008 22:48
Hi Greg,
I am hosting my WCF in IIS. I am getting this same error
This message cannot support the operation because it has been read.
Any Suggestions???
-
18 august 2008 21:38Moderator
Are you getting this when running against IIS without VS, or just when debugging within VS itself?
-Greg
-
8 februarie 2011 13:49
I have the same problem in debug mode in VS. When I try to invoke web method from WCF service hosted on IIS I've got error: This message cannot support the operation because it has been read.
I am hosting my WCF service in IIS 7.
I generated web reference for WCF web service. It used to give the same error, but after adding
< system.diagnostics >
< switches >
< add name = " Remote.Disable " value = " 1 " />
</ switches >
</ system.diagnostics >
to the config file it works fine.
When I generated WCF client for WCF service I still have the same problem: "This message cannot support the operation because it has been read."
Any help will be greatly appreciated!!
-
15 martie 2011 11:55Moderator
I think I finally figured this out. The stocktrader business service class has a special WCF service behavior: dispatch by body behevior. This is there for interop with WebSphere implementation, which includes the action in the message body, not the header. Anyway, this behavior cracks the message open to look for the action to dispatch to right service op. You can remove the behavior from the tradeservicewcf class. The next release will not have it at all, since it is just there to interop with an old, non standard web service implementation from IBM. For some reason, once the message body is cracked, the debugger cannot read it again.
-Greg
Greg Leake, Microsoft