Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# compiler error CS0433

Update 1: I have uploaded my project folder to dropbox - dropbox.com/s/8dfw3uprrynrhzx/S3Util.zip

I am new to Visual Studio, and I have created a small Windows Runtime Component in C# on Visual Studio 2012 Express for Windows 8.

My component consists of a single sealed class, with a single static method. I have added a unit test library project to the solution to test this static method.

(I followed this walkthrough to create a unit test)

When I build the solution, I get the following error:

Error 1     The type 'S3Util.S3Security' exists in both 'c:\workspace\vs\S3Util\S3Util\bin\Debug\S3Util.winmd' and 'c:\workspace\vs\S3Util\S3Util\bin\Debug\S3Util.winmd'
C:\workspace\vs\TestLib_S3Util\TestLib_S3Util\Test_Security.cs 18 27 TestLib_S3Util

The error help page on Microsoft website indicates that it is a Compiler Error CS0433.

However, my unit test library contains only one reference to my windows runtime component project, and even the error message I see is referring to the same .winmd file twice. Kindly help me understand the issue and how to resolve it.

Error screenshot: (click for full size)

like image 702
Anil Raj Avatar asked Nov 11 '12 21:11

Anil Raj


1 Answers

In cases when I don't know why the error occurs I'm starting to narrow the list of possibilities. I'd do the following:

  1. Look for a class S3Security via search. If you find 2 of them - remove one.
  2. Try to remove one of the references were added recently and compile. Remove till the project compiles.
  3. Try to remove latest files/projects untill solution compiles with no error. You can also try a reverse move, start to do the stes you were doing and check at which step you will get your error. Let us know what is it.
like image 178
Yaroslav Yakovlev Avatar answered Nov 18 '22 19:11

Yaroslav Yakovlev