Closed fahadabdulaziz closed 4 years ago
Same here.
Me too!
Nesting in this extension is done by adding the file to be nested to the ProjectItems collection of the parent item. That indeed does not work for .Net Standard projects.
To fix it it would need to replace the nesting code with:
setItemAttribute(outputFilePath, "DesignTime", true.ToString());
setItemAttribute(outputFilePath, "AutoGen", true.ToString());
setItemAttribute(outputFilePath, "DependentUpon", parent.Name);
void setItemAttribute(string itemFilePath, string name, string value)
{
IVsProject vsProject = // get the IVsProject for the item to be nested
IVsBuildPropertyStorage buildPropertyStorage = vsProject as IVsBuildPropertyStorage;
uint itemId;
(vsProject as IVsHierarchy).ParseCanonicalName(itemFilePath, out itemId);
buildPropertyStorage.SetItemAttribute(itemId, name, value);
}
Inspired by this article: https://docs.microsoft.com/en-us/visualstudio/extensibility/persisting-the-property-of-a-project-item?view=vs-2017
I hope this helps.
Installed product versions
Description
Nesting in VS 2017 is not working. I saw in readme file that it is not support. but it really supported!
On any csproj that targets Microsoft.NET.Sdk, edit it to add :
I'm not sure but I think it also supported in projects that targets Microsoft.NET.Sdk.Web
Steps to recreate
Current behavior
Do nothing!
Expected behavior
Do nesting and edit the CSProj to be like this: