Visual Studio New Blank App (Xamarin.Forms Shared)

Hey guys,

I noticed that after running the vstoolsforxamarin.exe installer I'm unable to create a working Xamarin.Forms Shared Project using Visual Studio. It looks like there are some missing references, I see a bunch of errors after the project is created "namespace name 'System' could not be found". I have run the Xamarin installer and rebooted a couple of times to make sure everything required was installed. vstoolsforxamarin.exe at least isn't complaining anything is missing. I have also run XamarinInstaller.exe universal installer.

I would guess that this is probably a bug since it was a clean install of VS on my PC (usually I run Visual Studio in VMs, so my desktop had nothing development related previously installed). My PC is Win 8.1 x64.

An example error (1 of 150ish):
Error CS0246 The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) App1.UWP C:\Users\Andrew\AppData\Local\Temp.NETCore,Version=v5.0.AssemblyAttributes.cs 2 Active

I think I can probably work around this by installing Xamarin Studio and making a new project with that, I can download this installer from the account dashboard XamarinStudio-5.10.3.51-0.msi. But I wanted to report this problem since the Xamarin devs probably want it to be a better out of the box experience.

Sorry if this is not the right place to report this problem. Is there a better place I should report this problem?

Thanks

Answers

  • AndrewPlummerAndrewPlummer USMember

    Also just wondering, is Xamarin Studio no longer recommended for Windows? I noticed it's not installed by the standard installer vstoolsforxamarin.exe

    I guess that would make sense if Visual Studio can provide the same features. Curious about the reasoning.

  • AndrewPlummerAndrewPlummer USMember

    I was able to install Xamarin Studio to make a new blank Xamarin Forms project which has allowed me to get started. However I haven't yet solved this problem using Visual Studio, new Shared or PCL Xamarin.Forms projects have many namespace not found errors for System. Seems that by default the references haven't been created correctly.

    I guess this will probably get bug fixed in an update soon since the Xamarin takeover by Microsoft is still pretty recent.

  • TobiasReikeTobiasReike DEMember

    Same problems for me in Visual Studio on Windows 10 pro. Any ideas how to fix that, yet?

  • AverageAskerAverageAsker AFMember

    I am also seeing identical problem on my several Windows 10 & VS 2015 Update 2 machines, how to move forward?

  • AndrewPlummerAndrewPlummer USMember
    edited May 2016

    Hi guys, if you want to workaround this in the meantime you may have to create your project using Xamarin Studio instead of VS. Xamarin Studio isn't part of the standard installer, so to get it you have to make an account on the Xamarin website which will allow you access to downloads.

    https://store.xamarin.com/account/my/subscription/downloads

    Under 'view all versions' you can find the Xamarin Studio installler
    http://download.xamarin.com/studio/Windows/XamarinStudio-5.10.3.51-0.msi

    You can install Xamarin Studio and then use that to start a new project. From what I could tell this is a bug in Visual Studio for creating new projects, we may have to wait for a bug fix in a newer version of Visual Studio / Xamarin tools for VS.

  • rufworkrufwork USMember ✭✭

    Same problem here with the default XAML Portable Cross Platform app. Here are the issues... Note that the Xam2.Windows and Xam2.WinPhone projects aren't in the Solution Explorer, so it's hard to "right-click on the project and choose 'Download Update'".

    lots of errors

    There's also a nice set of errors related to the UWP project.

    Strangely, on a laptop I just set up, everything works perfectly. Tempted to do a clean reinstall of VS. In any event, there's a solution other than using XamStud. Just not sure exactly what it is yet. ;^)

  • Rene-SackersRene-Sackers USMember
    edited December 2016

    Exact same problem going on here.
    Just created a new XAML Shared project, all other projects build, except for the UWP one.

    Reloading the project/Visual Studio results in "InitializeComponent" being unavailable upon build.

    So, here's a temporary solution.
    1. unload the UWP project
    2. edit the .csproj
    3. remove the reference similar to this one (line 133 for me):
    <Import Project="..\[project name]\[project name].projitems" Label="Shared" Condition="Exists('..\[project name]\[project name].projitems')" />
    4. reload project
    5. add reference to shared project

    Seems to build and run like that. Haven't tested any further.

  • EHearnEHearn USMember

    I ran into this issue as well. I solved it by installing the Microsoft.NETCore.UniversalWindowsPlatform NuGet package as a reference for the UWP project.

Sign In or Register to comment.