GithubHelp home page GithubHelp logo

Comments (3)

GangWang01 avatar GangWang01 commented on July 17, 2024 1

I verified with VS 17.10.2, 17.9.7, 17.8.7. It was reproed in 17.10.2, not reproed in early versions 17.9.7, 17.8.7. It's a regression issue.
It didn't repro with msbuild.exe cli or dotnet build cli for these installed VS versions including 17.10.2.

from msbuild.

rainersigwald avatar rainersigwald commented on July 17, 2024

Stack:

 	Microsoft.Build.dll!Microsoft.Build.Shared.ErrorUtilities.ThrowArgument(System.Exception innerException, string resourceName, object[] args) Line 352	C#
 	Microsoft.Build.dll!Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument(bool condition, System.Exception innerException, string resourceName, object arg0) Line 421	C#
 	Microsoft.Build.dll!Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgument(bool condition, string resourceName, object arg0) Line 369	C#
 	Microsoft.Build.dll!Microsoft.Build.Execution.ProjectPropertyInstance.Create(string name, string escapedValue, bool mayBeReserved, Microsoft.Build.Construction.ElementLocation location, bool isImmutable, bool isEnvironmentProperty, Microsoft.Build.BackEnd.Logging.LoggingContext loggingContext) Line 301	C#
 	Microsoft.Build.dll!Microsoft.Build.Execution.ProjectPropertyInstance.Create(string name, string escapedValue, bool mayBeReserved, bool isImmutable, bool isEnvironmentProperty, Microsoft.Build.BackEnd.Logging.LoggingContext loggingContext) Line 201	C#
 	Microsoft.Build.dll!Microsoft.Build.Execution.ProjectInstance.InstantiateProjectPropertyInstance(Microsoft.Build.Evaluation.ProjectProperty property, bool isImmutable) Line 2888	C#
>	Microsoft.Build.dll!Microsoft.Build.Execution.ProjectInstance.CreatePropertiesSnapshot(System.Collections.Generic.ICollection<Microsoft.Build.Evaluation.ProjectProperty> properties, bool isImmutable) Line 3222	C#
 	Microsoft.Build.dll!Microsoft.Build.Execution.ProjectInstance.ProjectInstance(Microsoft.Build.Evaluation.Project project, Microsoft.Build.Execution.ProjectInstanceSettings settings) Line 380	C#
 	Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.ProjectSerialization.CachedProject.CreateProjectInstance(Microsoft.Build.Execution.ProjectInstanceSettings settings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) Line 474	C#
 	Microsoft.Build.dll!Microsoft.Build.Evaluation.Project.CreateProjectInstance(Microsoft.Build.Execution.ProjectInstanceSettings settings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) Line 1388	C#
 	Microsoft.Build.dll!Microsoft.Build.Evaluation.Project.CreateProjectInstance(Microsoft.Build.Execution.ProjectInstanceSettings settings) Line 1377	C#
 	Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.Designers.ProjectSnapshotService.GenerateProjectInstance(System.IComparable configuredProjectVersion, Microsoft.VisualStudio.ProjectSystem.IProjectVersionedValue<Microsoft.VisualStudio.ProjectSystem.IProjectSnapshotInternal> latestSnapshot, Microsoft.Build.Evaluation.Project project, bool isProjectDirty) Line 298	C#
 	Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.Designers.ProjectSnapshotService.Initialize.AnonymousMethod__1() Line 171	C#

InstantiateProjectPropertyInstance is new from 2a789cd#diff-40f77147ccc6867c10324ec4ddf8110ede2e43499d939b73ef83c7f5febb7a75L3001, but it's just a thin wrapper over ProjectPropertyInstance.Create:

private static ProjectPropertyInstance InstantiateProjectPropertyInstance(ProjectProperty property, bool isImmutable)
{
// Allow reserved property names, since this is how they are added to the project instance.
// The caller has prevented users setting them themselves.
var instance = ProjectPropertyInstance.Create(
property.Name,
((IProperty)property).EvaluatedValueEscaped,
true /* MAY be reserved name */,
isImmutable,
property.IsEnvironmentProperty);
return instance;
}

So that should be doing the same thing as before.

And I confirm in the debugger that by the time we get to the line that throws we're still carrying the correct mayBeReserved = true. But the problem is that's not respected when checking against the reserved Item name list:

private static ProjectPropertyInstance Create(string name, string escapedValue, bool mayBeReserved, ElementLocation location, bool isImmutable, bool isEnvironmentProperty = false, LoggingContext loggingContext = null)
{
// Does not check immutability as this is only called during build (which is already protected) or evaluation
ErrorUtilities.VerifyThrowArgumentNull(escapedValue, nameof(escapedValue));
if (location == null)
{
ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(name), "OM_ReservedName", name);
ErrorUtilities.VerifyThrowArgument(mayBeReserved || !ReservedPropertyNames.IsReservedProperty(name), "OM_CannotCreateReservedProperty", name);
XmlUtilities.VerifyThrowArgumentValidElementName(name);
}

However that code is unchanged for 6 years so is not the cause of a 17.9->17.10 regression.

from msbuild.

rainersigwald avatar rainersigwald commented on July 17, 2024

Building MSBuild 17.9 and plunking it into VS 17.11 repros the failure so it looks like a change in another layer. I'm going to reactivate the VS feedback and investigate further there.

from msbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.