Compilation error on new Xamarin Forms project - xamarin

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:
Using Home Brew
Using the Visual Studio For Mac installer
Any pointers on how to work around this one will help.
Please look below Error Message

You cannot have a dash in your namespace. Try using TestAppXamarin or TestApp.Xamarin instead:
namespace TestApp.Xamarin {
public class TestAppClass { }
}

Related

Error 'Xamarin/Xamarin.h' file not found (Xamarin.Forms)

I'm a mac developer trying out xamarin. I first tried Xamarin.Mac, but found that there was barely any support on that, so I added in Xamarin.Forms by adding some code and importing a NuGet package.
I'm using xcode for UI design and Visual Studio Mac 2022 for this, but whenever I try to run it throws the error 'xamarin/xamarin.h' file not found. I don't have a xamarin.h file, and don't know how to create one.

Errors while using Sqlite-net on Xamarin studio

I am using sqlite-net in Xamarin Studio for Xamarin.forms application. In that I have put the sqlite-net library version 1.0.8. I have created the interface which I would be implementing in the platforms. But when I try to compile the PCL project I am getting a lot of errors which are present in the SQLite.cs file which was added when I added the PCL for sqlite-net.
I initially thought that the file is not important but it started giving more errors in the application. How to resolve this issue?
I am using a video tutorial for which used Visual studio for making the sample.
I am attaching the pic for the same. I would like to mention that the problem is not in my file the compile time errors are in the library.
EDIT: The PCL version of the package is 1.0.8
I had added the file in the application with content
using System;
using SQLite;
namespace SQLiteExample
{
public interface ISQLite
{
SQLite.SQLiteConnection GetConnection();
}
}
You should use SQLite-Net-PCL instead of SQLite-Net.

Can not reference System.data Error when creating project

I am using Visual Studio 2015 Enterprise to generate Coded UI Tests. Things have been working well until this morning. When I attempt to create a new Solution/Project, I am given the following error:
I am then able finish loading the project. However, I see another issue in solution explorer:
Note that there is no path given for the selected reference. If I try to remove it/add it back as a reference manually, I still do not see a path or version. I have tried the following:
Selected different .Net framework versions when creating the solution/project
Tried different project types: Window Forms, Class Library
Repaired visual studio
Repaired .Net Framework 4.6.1
So far I have been unable to make the error go away. Any other suggestions?
I was not able to resolve this issue. I ended up performing a reinstall of the OS/Visual Studio to get things working again.

Problems installing Roslyn Preview

I am having some troubles installing the Roslyn Preview.
I am using VS 2013 Premium.
I've download the package from the site and installed the vsix and everything goes well no errors.
But even after restarting VS it still does not recognize the new language features.
Tried that 3 times. Even restarting the machine but nothing works.
Does anyone knows how to correct that?
Thanks
==== Added for clarification as requested ====
The code does not compile. It complains on the code as the preview didn't exists.
In the following simple sample:
if (int.TryParse(value, out int result)) { ... }
It complains with the "int" and does not declare the result variable.
In other words it is still using the old syntax.
Just for additional information I also have Resharper v8 installed. I don't know if it is relevant (should not be actually).
I've manage to solve the conundrum.
Restarting Visual Studio is not enough. You have to create a new project.
Even if you want to use the Preview in an existing project you have to create a new project and just discard it.
After that reopen the previous existing one and the compilation will proceed with the new standards.
One note about Resharper:
Since Resharper does not yet recognize the new syntax it will color the "errors" in red and put the squiggly line but now the code is compiling and the build does not generate any errors.

VS2010 Silverlight templates not compiling: "WebContextBase is not defined". What's going on? How do I get this working?

I'm beginning my first explorations into Silverlight RIAs and EF4, but I can't get a project to run right off the templates that ship with VS2010 SP1.
Bear in mind here that what I've done is to install a brand new Windows 7 VM, and then I immediately installed LightSwitch Beta 2. Following that, I added VS2010 Premium, and applied Service Pack 1 to that.
The client portion of the Template app is kicking off three warnings and two errors; the details are posted below. It's looking for a WebContextBase class that it can't find, in code that it generated into Web.g.vb (and Web.g.cs) files. So far this project is entirely generated off the solution template; I haven't added a single line of code to what VS2010 generated.
I've since gotten EF4 to work fine in WinForms projects and Light Switch projects.
What's going on here, and how do I fix it?
------ Build started: Project: EF4Test, Configuration: Debug Any CPU
------ C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(21)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(22)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices.Client'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(23)
: warning BC40056: Namespace or type
specified in the Imports
'System.ServiceModel.DomainServices.Client.ApplicationServices'
doesn't contain any public member or
cannot be found. Make sure the
namespace or the type is defined and
contains at least one public member.
Make sure the imported element name
doesn't use any aliases.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(34)
: error BC30002: Type 'WebContextBase'
is not defined.
C:\Users\Rob\Documents\Visual Studio
2010\Projects\EF4Test\EF4Test\Generated_Code\EF4Test.Web.g.vb(65)
: error BC30451: 'WebContextBase' is
not declared. It may be inaccessible
due to its protection level.
Have a look at LightSwitch Beta 2 Readme
There are few know issues with the LightSwitch. From the steps you have described to setup your system I would guess that the problem could be because
"2.1.1 Visual Studio 2010 users or
Visual Studio 2010 SP1 Beta1 users
must install Visual Studio 2010 SP1
before installing Visual Studio
LightSwitch Beta2"
You should try uninstalling LightSwitch Beta2 and then reinstall, and let us know if you get the same error.
Hope this helps.
Include this reference..
System.ServiceModel.DomainServices.Client.ApplicationServices

Resources