.NET Compile Issues with Service References

clock December 30, 2008 21:00 by author Giovanni

I was working on a Silverlight application and went to create a service reference to a WCF service.  The files generated properly, but when I went to compile I got a few errors that looked similar to below:

The type name 'MyService' does not exist in the type
'MyProjectNamespace.MyProjectNamespace'
C:\..\Service References\MyService\Reference.cs

I though it was very strange because this is code that was generated by Visual Studio .NET 2008.  After playing with it for a while, I decided to try creating the reference in another application with nothing in it.  It worked perfectly.  The problem I ran across has to do with naming issue.  The reason it failed is because there was a class with the same name as the namespace of the project.  For example, if the namespace is called EmployeeAdmin, and there is also an EmployeeAdmin class, everything will work until you create a service reference.  It throws an error because the interfaces are generated in the reference.cs file and look like this:

public interface MyServiceChannel : EmployeeAdmin.MyServiceRefName.MyService,
System.ServiceModel.IClientChannel
{ }

The compiler is getting confused and thinks you are inheriting from a type within the EmployeeAdmin class rather than the EmployeeAdmin namespace.  The only way to fix this, that I know of is to rename your class so that it doesn't match your namespace.  I'm sure there's some documentation somewhere that says to never name a class the same as a Namespace.  Under normal conditions, it wouldn't be a problem, but here's an example where it can be.



Updated Blu-Ray / DVD Comparison Utility

clock December 29, 2008 20:37 by author Giovanni

I updated my blu-ray/dvd comparison utility. The new version has a larger set of pre-loaded images to compare against. I also added the ability to create a link that shows the current images you are currently viewing.  If you are using the rectangle mode, the created link will be defined so that when others click on it, they can see the original rectangle you created which is good when trying to point out a particular location. Click the following link to check it out: Blu-ray/DVD Comparison

I'll be adding more features soon.