Skip to content

Unable to load Xamarin Project... #4

Description

@drarsalan

I am trying to load a solution which has xamarin project. I get the following exception.

Microsoft.Build.Exceptions.InvalidProjectFileException : The attribute "Version" in element <PackageReference> is unrecognized.  MyProject.Android.csproj
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   at Microsoft.Build.Internal.ProjectXmlUtilities.ThrowProjectInvalidAttribute(XmlAttributeWithLocation attribute)
   at Microsoft.Build.Internal.ProjectXmlUtilities.VerifyThrowProjectAttributes(XmlElementWithLocation element, String[] validAttributes)
   at Microsoft.Build.Construction.ProjectParser.ParseProjectItemElement(XmlElementWithLocation element, ProjectItemGroupElement parent)
   at Microsoft.Build.Construction.ProjectParser.ParseProjectItemGroupElement(XmlElementWithLocation element, ProjectElementContainer parent)
   at Microsoft.Build.Construction.ProjectParser.ParseProjectRootElementChildren(XmlElementWithLocation element)
   at Microsoft.Build.Construction.ProjectParser.Parse()
   at Microsoft.Build.Construction.ProjectParser.Parse(XmlDocumentWithLocation document, ProjectRootElement projectRootElement)
   at Microsoft.Build.Construction.ProjectRootElement..ctor(String path, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext)
   at Microsoft.Build.Construction.ProjectRootElement.CreateProjectFromPath(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext)
   at Microsoft.Build.Construction.ProjectRootElement.<>c__DisplayClass169_0.<OpenProjectOrSolution>b__0(String path, ProjectRootElementCache cache)
   at Microsoft.Build.Evaluation.ProjectRootElementCache.Get(String projectFile, OpenProjectRootElement openProjectRootElement, Boolean isExplicitlyLoaded)
   at Microsoft.Build.Construction.ProjectRootElement.OpenProjectOrSolution(String fullPath, IDictionary`2 globalProperties, String toolsVersion, ILoggingService loggingService, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, Boolean isExplicitlyLoaded)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ProjectCollection projectCollection)
   at net.r_eg.MvsSln.Core.IsolatedEnv.Load(String path, IDictionary`2 properties) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 335
   at net.r_eg.MvsSln.Core.IsolatedEnv.Load(ProjectItem pItem, IDictionary`2 properties) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 323
   at net.r_eg.MvsSln.Core.IsolatedEnv.GetOrLoadProject(ProjectItem pItem, IDictionary`2 properties) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 209
   at net.r_eg.MvsSln.Core.IsolatedEnv.GetOrLoadProject(ProjectItem pItem, IConfPlatform cfg) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 170
   at net.r_eg.MvsSln.Core.IsolatedEnv.Load(IEnumerable`1 pItems) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 312
   at net.r_eg.MvsSln.Core.IsolatedEnv.LoadProjects(IEnumerable`1 pItems) in D:\My Documents\Projects\MvsSln\MvsSln\Core\IsolatedEnv.cs:line 266
   at net.r_eg.MvsSln.Core.SlnParser.Parse(StreamReader reader, SlnItems type) in D:\My Documents\Projects\MvsSln\MvsSln\Core\SlnParser.cs:line 151
   at net.r_eg.MvsSln.Core.SlnParser.Parse(String sln, SlnItems type) in D:\My Documents\Projects\MvsSln\MvsSln\Core\SlnParser.cs:line 103
   at net.r_eg.MvsSln.Sln..ctor(String file, SlnItems type) in D:\My Documents\Projects\MvsSln\MvsSln\Sln.cs:line 54

The project file has the following information.

  <ItemGroup>
    <PackageReference Include="Xamarin.Forms" Version="2.5.0.122203" />
    <PackageReference Include="Xamarin.Android.Support.Design" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="25.4.0.2" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="25.4.0.2" />
    <PackageReference Include="Microsoft.Azure.Mobile.Client" Version="4.0.1" />
    <PackageReference Include="Microsoft.Azure.Mobile.Client.SQLiteStore" Version="4.0.1" />
  </ItemGroup>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions