0

I have installed Visual Studio for Mac (7.0.1 build 24 Community Edition), generated a new project using Forms, and could not get it to compile. The error shown makes no sense to me since the code looks correct.

I have not made any change to the code. It is as generated by the Wizard.

I have tried the following ways of setting up, on different machines:

  1. Using Home Brew
  2. Using the Visual Studio For Mac installer

Any pointers on how to work around this one will help.

Please look below Error Message

enter image description here

Ziyad Godil
  • 2,620
  • 1
  • 14
  • 36
  • Could you show the complete file where this error is appearing? You named your app TestApp-Xamarin? The name of your app becomes the global namespace and C# doesn't allow dashes "-" in any identifier. Try creating a new app without the dash. – pinedax Aug 02 '17 at 04:19
  • Hah !! The IDE should not have allowed this, or the error message should have been a little more explicit about it. Obviously led me down a different track. – Navneet Karnani Aug 02 '17 at 04:45

1 Answers1

0

You cannot have a dash in your namespace. Try using TestAppXamarin or TestApp.Xamarin instead:

namespace TestApp.Xamarin {
    public class TestAppClass { }
}
hvaughan3
  • 10,955
  • 5
  • 56
  • 76