Build project created by CustomProject sample throws Microsoft.Build.Exceptions.InvalidProjectFileException - Cannot evaluate the item metadata "%(FullPath)" - ErrorCode=MSB4023

Jul 27, 2012 at 8:13 AM

Hi,

 

I've trying to create a project based on template from CustomProject sample and I meet an InvalidProjectFileException when trying to Build this project.

Please help me on this problem. This issue happened on Visual 2010, 2011 Beta and 2012 RC.

Here are my steps (run on Debug Mode):

- Open CustomProject on Samples folder.

- Build and Start Debug

- On a new Visual Studio (debug extension), try to create a new project with My Custom Project template

- After project created and load successful on Solution Explorer, try Build Project

 

The Exception is throwned:

 

Microsoft.Build.Exceptions.InvalidProjectFileException was unhandled by user code  HResult=-2146233088  Message=Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "obj\Debug|x86\MyApplication.exe". Illegal characters in path.  C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets  Source=Microsoft.Build  BaseMessage=Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "obj\Debug|x86\MyApplication.exe". Illegal characters in path.  ColumnNumber=39  EndColumnNumber=0  EndLineNumber=0  ErrorCode=MSB4023  HasBeenLogged=true  HelpKeyword=MSBuild.CannotEvaluateItemMetadata  LineNumber=4567  ProjectFile=C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets  StackTrace:       at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)       at Microsoft.Build.Evaluation.Expander`2.ItemExpander.MetadataMatchEvaluator.GetMetadataValueFromMatch(Match match)       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat)       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)       at Microsoft.Build.Evaluation.Expander`2.ItemExpander.IntrinsicItemFunctions`1.<ExpandQuotedExpressionFunction>d__3f.MoveNext()       at Microsoft.Build.Evaluation.Expander`2.ItemExpander.<Transform>d__0`1.MoveNext()       at Microsoft.Build.Evaluation.Expander`2.ItemExpander.<Transform>d__0`1.MoveNext()       at Microsoft.Build.Evaluation.Expander`2.ItemExpander.ExpandSingleItemVectorExpressionIntoItems[S,T](Expander`2 expander, String expression, IItemProvider`1 items, IItemFactory`2 itemFactory, ExpanderOptions options, Boolean includeNullEntries, Boolean& isTransformExpression, IElementLocation elementLocation)       at Microsoft.Build.Evaluation.Expander`2.ExpandSingleItemVectorExpressionIntoItems[T](String expression, IItemFactory`2 itemFactory, ExpanderOptions options, Boolean includeNullItems, Boolean& isTransformExpression, IElementLocation elementLocation)       at Microsoft.Build.Evaluation.Evaluator`4.CreateItemsFromInclude(String rootDirectory, ProjectItemElement itemElement, IItemFactory`2 itemFactory, String unevaluatedIncludeEscaped, Expander`2 expander)       at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemElement(Boolean itemGroupConditionResult, ProjectItemElement itemElement)       at Microsoft.Build.Evaluation.Evaluator`4.EvaluateItemGroupElement(ProjectItemGroupElement itemGroupElement)       at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()       at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCache projectRootElementCache, BuildEventContext buildEventContext, ProjectInstance projectInstanceIfAnyForDebuggerOnly)       at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation)       at Microsoft.Build.Evaluation.Project.CreateProjectInstance(ILoggingService loggingServiceForEvaluation, ProjectInstanceSettings settings)       at Microsoft.Build.Evaluation.Project.CreateProjectInstance()       at Microsoft.VisualStudio.Project.ProjectNode.SetConfiguration(String config) in d:\mpfproj10\Dev10\Src\CSharp\ProjectNode.cs:line 3577       at Microsoft.VisualStudio.Project.ProjectConfig.GetMsBuildProperty(String propertyName, Boolean resetCache) in d:\mpfproj10\Dev10\Src\CSharp\ProjectConfig.cs:line 688       at Microsoft.VisualStudio.Project.ProjectConfig.GetConfigurationProperty(String propertyName, Boolean resetCache) in d:\mpfproj10\Dev10\Src\CSharp\ProjectConfig.cs:line 164       at Microsoft.VisualStudio.Project.ProjectNode.Microsoft.VisualStudio.Shell.Interop.IVsBuildPropertyStorage.GetPropertyValue(String propertyName, String configName, UInt32 storage, String& propertyValue) in d:\mpfproj10\Dev10\Src\CSharp\ProjectNode.cs:line 5740  InnerException: 

 

 

Thanks,