visual-studiowcfwcf-clientproject-reference

Adding WCF proxy class hides Visual Studio project reference


I have a weird visual studio error which is bugging me.

I am using Visual Studio 2010

My solution is small and contains 2 projects:

Project 1 a class library contains the following classes:

  1. Namespace1.DataClass (a serializable class to hold data)
  2. Namespace2.AccessorClass (a class with a method to pull instances of Namespace1.DataClass from a database via Linq to Sql)

Project 2, a console application contains the following classes:

  1. Namespace3.Program (with main function which pulls data from the database and sends it via a wcf service)
  2. Namespace4.WCFProxy (a wcf proxy generated by svcutil)

The WCF client sends objects to the service in the form of:

[System.Runtime.Serialization.KnownTypeAttribute(typeof(Namespace1.DataClass))]
public class SendItem
{
    public object Item { get; set; }
    public string Label { get; set; }
}

(This is generated by svcutil, so I am paraphrsing to save space)

So, within my proxy class there is a reference to Namespace1.DataClass.

When building my application I first created the project to access the database, I then created my console app, I added a reference from my console app to my my class library and finally I generated my proxy and added it (un-edited) to the console app project.

Everything looks fine, no VS compile errors BEFORE building. Then, when I build, VS seems to forget the reference from my console app project to my class library project and I get a heap of compile errors accordingly.

If I exclude my proxy class from the project, VS can see the reference again. If I re-add the proxy everything is still fine (no errors and full intellisense support) but click build and everything goes haywire again.

Has anyone come across this issue before?

Cheers Shane


Solution

  • It was log4net, beware of this behavior in future.

    Just to clarify, this problem had nothing to do with WCF as I though it did.