.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WCF Fault DataContract Not Reconized By Compiler

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :.NET Framework

Can someone tell me which library I need to include into my code to make the complier recognize my Fault [DataContract]?


Below is my code....














View Complete Post

More Related Resource Links

Compiler-generated scopes for local variable declarations

I was tasked with understanding and fixing a bug on error reporting with foreach iteration variables the other day, and it got me thinking about local variable scoping rules in C# in general. First, the bug.

Compiler Error Message : CS0006: Metadata file 'System.EnterpriseServices.dll' could not be found


I get this error when i Debug my web application....


I followed these steps.,

  • Ended the aspnet_wp.exe process in the Windows Task Manager
  • Then deleted the application`s folder in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
  • Then started Visual Studio 2008 again

I also rebooted my system but no use....

Plz help !

Test Run: Fault Injection Testing with TestApi


Fault injection testing is the process of deliberately inserting an error into an application to determine whether it deals with the error properly. We'll explain how you can introduce faults into .NET applications at run time using the Managed Code Fault Injection APIs of the TestApi library

James McCaffrey

MSDN Magazine August 2010

Data Points: Data Performance and Fault Strategies in Silverlight 3


In this month's column, the author shows how binary encoding works, the effect it has on an application's performance, and how it behaves by demonstrating it in action.

John Papa

MSDN Magazine August 2009

Roll Your Own: Create a Language Compiler for the .NET Framework


Joel Pobar presents an introduction to how compilers work and how you can write your own compiler to target the .NET Framework.

Joel Pobar

MSDN Magazine February 2008

Advanced Basics: Scaling Up: The Very Busy Background Compiler


One of the features that distinguishes Visual Basic® from the other languages in Visual Studio® is its use of a background compiler (BC). The BC runs from the moment you start up a Visual Basic project until the time you close the last one down.

Matthew Gertz

MSDN Magazine June 2005

C++ Rules: Power Your App with the Programming Model and Compiler Optimizations of Visual C++


Many programmers think that C++ gets good performance because it generates native code, but even if your code is completely managed you'll still get superior performance. In Visual Studio 2005, the C++ syntax itself has been greatly improved to make it faster to write. In addition, a flexible language framework is provided for interacting with the common language runtime (CLR) to write high-performance programs. Read about it here.

Kang Su Gatlin

MSDN Magazine January 2005

Still in Love with C++: Modern Language Features Enhance the Visual C++ .NET Compiler


Programmers who have been using C++ for years are wondering where their language is headed with the advent of C# and Microsoft .NET. This article sketches a roadmap of C++ as it is used in the world of .NET. In .NET there are two approaches to C++ code: managed and unmanaged. Unmanaged code doesn't use the CLR, while managed code involves the use of Managed Extensions for C++. This discussion explains both approaches.

Stanley B. Lippman

MSDN Magazine February 2002

Classes created inside App_Code dir is ignored by the compiler



I have the following problem programming in asp .net with visual studio 2008. If I insert a new class file, right clicking on "add new element -> class -> ecc..." directly inside the App_Code directory (or in its any subdirectory) the compiler and the smartTab do not see any custom namespace previously created in other classes, nor from other classes I can find the namespace and the class name defined within the new class file just inserted. The only way I found to correctly insert a new class file is create it right clicking on "add new element... ecc..." not in the App_Code (or sub) directory but rather in the root node with the name of the entire project, and then I can move it in the destination App_Code subdirectory, and it keeps working.

As a matter of facts it seems that is not important where the file IS but rather where I CREATED it: if I created a class from inside the App_Code it does not see anything and it is not seen by any other class, otherwise if I create it right clicking on the root node of the project it works and keeps workng even moving inside any subdir within the project.

I also tried to manually add the App_Code subdirs to the <Compilation> and <codeSubDirectories> tags of the Web.config file, but anything changed with this behaviour.

Does anybody know why?


How can I solve this problem?::Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.Cryst


I upgraded my web application from visual studio 2003 to 2008. When I want to create a report in visual studio 2008 and receiving this error at runtime. I am able to compile but when runnning thats when I am getting this error.

How can I solve this problem? please help.

Compilation Error

Server Error in '/IRPSDEV' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\irpsdev\9e97e0a9\94a2ecd\assembly\dl3\151eb571\00df56e1_6064c201\CrystalDecisions.Web.DLL'

Source Error:

Line 161:        
Line 162:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 163:        private global::CrystalDecisions.Web.CrystalR

LINQ to SQL compiler error CS1519: Invalid token 'void' in class, struct, or interface member decl

I get the following compiler errors when creating my first LINQ to SQL class (I just dragged a table "ProfileExtended" onto the designer and hit build):DataClasses.designer.cs(31,11): error CS1519: Invalid token 'void' in class, struct, or interface member declaration these are the offending lines of autogenerated code:#region Extensibility Method Definitions  partial void OnCreated();  partial void InsertProfileExtended(ProfileExtended instance);  partial void UpdateProfileExtended(ProfileExtended instance);  partial void DeleteProfileExtended(ProfileExtended instance);  #endregion

WCF on GoDaddy - Compiler doesn't recognize [OperationContract]

I've created a bare-bones WCF service (with just the default DoWork method in order to simplify things) and it compiles and runs just fine on my local computer running Visual Studio. When I deploy the service to my GoDaddy server, I get the following error. Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'OperationContract' could not be found (are you missing a using directive or an assembly reference?) Source Error: Line 10: public interface IShtibLuachWcfService Line 11: { Line 12: [OperationContract] Line 13: void DoWork(); Line 14: [OperationContract] Source File: d:\hosting\4541103\html\App_Code\IShtibLuachWcfService.cs Line: 12 Show Detailed Compiler Output: C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\\System ..Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Services\ 3a\System.Web.Services.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\\Sy stem.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Co

Is it a good practice to use DataContract attributes on business entities

Hi Folks, Currently I am developing a framwork for travel industry and finally my framework will expose its operations in the form of WCF Service. I was wondering if it is a good idea to decorate your entities and class with DataContract attributes. I know this is required if you want your classes/fields to be serialized/deseralized.  However, by Adding these attributes mean you are making your entities service specific which I believe not a good idea. Service and domain specific entities should be seperate. One solution to this would be to make DTOs and decorate them with these attributes and this make sense as core purpose of these DTOs is serialization and deserialization. What can be other options....? Please share your thoughts. Thanks, Naeem

Problem: DataContract and DataMember attributes are not being recognized

I am having a strange problem. My service is otherwise working fine. However, now I want to add a custom object to be sent over to clients. I created a class to hold the data applied DataContract and DataMember attributes. However, compiler is not recognizing these attributes and giving me following error. The type or namespace name 'DataContractAttribute' could not be found (are you missing a using directive or an assembly reference?)  I could not figure our what assembly do I need to refer to. I am using VS2010 on WinXP. Thanks. kr

FaultException : "The creator of this fault did not specify a reason" error

I have a simple service to return a custom SOAP Fault. And here is what the service throws MappingError me = new MappingError(); me.ErrorCode = ErrorType.OrderMappingFailed; me.Message = "Order mapping failed"; throw new FaultException<MappingError>(me); At this point i get an exception "The creator of this fault did not specify a reason". Looking around i see there is a FaultReason(String) class and  FaultException<> has a readonly Reason property. So, i used one of the overloaded constructor to set the FaultReason and made it work. Here is the working code MappingError me = new MappingError(); me.ErrorCode = ErrorType.OrderMappingFailed; me.Message = "Order mapping failed"; FaultException<MappingError> fe = new FaultException<MappingError>(me, new FaultReason("Order Guid is NULL")); throw fe; Now, will this be the behaviour when Winfx ships. If that be the case please update the FaultException<>  SDK docs. [ServiceContract] public interface IMyService { [OperationContract] [FaultContract(typeof(MappingError))] Guid SendRequest(int ID); }   [DataContract] public class MappingError { [DataMember] public ErrorType ErrorCode; [DataMember] public String Message; }

FaultContract - can I use non soap fault messages

I want to use the FaultContract functionality for reporting errors but I want to completely define the message on the wire (as I do in the MessageContract) - I do NOT want the message to appear as a soap fault on the wire.  Is that possible?  I guess what I really want is for a contract to have two possible results, the normal successful result and a specialist exception result.  This is for something to go through an XML guard and a soap fault doesn't meet the IDL spec.   I'd be grateful for any pointers   Thanks

JIT Compiler Issue

I have a pretty big project with about 60 forms.  Everytime I run the exe the JIT seems to recompile everything from scratch.  The problem is that when I open the application it is very slow.  Then when I open each form for the first time it is very slow.  Once the application has opened the form even if I close it and then reopen it, it is very fast.  This only happens when I run the application for the first time.  To make matters worse when I close the application and then start the application all over again it is slow until the user has opened each for again.  I understood that the JIT was supposed to save a copy of the compiled exe and when you run it, there is a checksum run to make sure it has not changed if it has not changed then it does not compile it again.  Does anyone have any ideas about how to fix this so that it is not slow all the time like this.  The version has not changed so I would think it would not have a need to compile it each time. Thanks in advance
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend