We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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>
The text was updated successfully, but these errors were encountered:
Thanks for the report, @drarsalan
The attribute "Version" in element is unrecognized.
More like because of unrelated schema.
Can you also attach this project file (.csproj etc) ? Seems problem again with backward compatibility exactly in MS internal logic as for #2
Temporarily, you can try to override IsolatedEnv.Load with own logic
IsolatedEnv.Load
MvsSln/MvsSln/Core/IsolatedEnv.cs
Line 333 in a84f0f2
Like we use this also in DllExport project to avoid some related problems:
Sorry, something went wrong.
@drarsalan #5 (comment) solves problem via other version of Microsoft.Build.dll. Check this out.
(.netfx 4.6+ for today)
No branches or pull requests
I am trying to load a solution which has xamarin project. I get the following exception.
The project file has the following information.
The text was updated successfully, but these errors were encountered: