views:

17

answers:

2

Hi Guys,

I am facing a problem with WCF connectavity with silverlight. In my interface I wrote the DoWork method for asynchronous and normal calls.

#if SILVERLIGHT
    [OperationContract(AsyncPattern=true)]
    IAsyncResult BeginDoWork(bool opt, AsyncCallback callback, object state);

    string EndDoWork(IAsyncResult result);
#else
    [OperationContract]
    string DoWork(bool opt);
#endif

When I start coding the interface "#if SILVERLIGHT" content is gray color and "#else" content is colored(blue, black).

After some code changes when I seen interface code the colors are swaped. "#if SILVERLIGHT" content is colored(blue, black) and "#else" content is gray color. I don't know what I did wrong.

Please any one can help me to solve this issue

http://satyendrakumarp.spaces.live.com/blog/cns!1571EB24C5E78234!167.entry

Thank You, Satyendra

+3  A: 

The code coloring reflects the code that will actually be included during compilation. If the color has changed it would suggest the code is now part of a project that has the "SILVERLIGHT" conditional compilation symbol defined in the Build tab of the project properties. This is what you would expect in a Silverlight project and is part of the Silverlight project templates.

AnthonyWJones
A: 

Hi

I understand what you mean. But I was unable to call the DoWork method from silverlight as earlier. Earlier it is working fine.

Satyendra

Satyendra
In stackoverflow we do not use __Answers__ conversationly. Note the `add comment` link under my answer, this is where you should have placed the above comment. It might be a good idea to for you to read the FAQ since Stackoverflow is different from other forums you have used in the passed. As to your comment is sounds to me like what was happening before was errant, what is happening now is as it should be. Note Silverlight can only use WCF asynchronously.
AnthonyWJones