Skip to content
New issue

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

Content Visible=false hides the item, but not the directories in Solution Explorer #162

Closed
tomasherceg opened this issue Jan 6, 2017 · 5 comments

Comments

@tomasherceg
Copy link

I don't know whether this is project system or NuGet issue, however I have used a snippet from NuGet docs (https://docs.nuget.org/ndocs/schema/msbuild-targets#including-content-in-package) in my CSPROJ file to add additional files in my NuGet package:

  <ItemGroup>
    <Content Include="..\DotVVM.Compiler\bin\$(Configuration)\DotVVM.Compiler.exe">
      <Pack>true</Pack>
      <PackagePath>tools</PackagePath>
      <Visible>false</Visible>
    </Content>
  </ItemGroup>

The Visible element works well, so the file is hidden in the Solution Explorer, however I can still see the path including the ".." folder which is quite weird.

screenshot

I see this behavior in VS 2017 RC build 15.0.26020.0.

@jviau
Copy link
Member

jviau commented Jan 18, 2017

Yes this is a known issue. We are discussing options to resolve it over here dotnet/project-system#1233

@amaitland
Copy link

Using VS2019 16.4.3 I have a Nupkg that contains a .targets file that includes the following:

<ItemGroup Condition="'$(PlatformTarget)' == 'x64'">
	<Content Include="@(CefRedist64)">
	  <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
	  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
	  <Visible>false</Visible>
	</Content>
</ItemGroup>

The folder structure contains subfolders which appear in the project tree without any files in them. The Visible entry hides the files, not the folders as expected. It's a Project Sdk="Microsoft.NET.Sdk.WindowsDesktop" project.

dotnet/project-system#1233 was closed quite some time ago, was this issue resolved? Are changes required?

The CefSharp.MinimalExample.netcore.sln in https://github.com/cefsharp/CefSharp.MinimalExample/tree/testing/packagereference contains an example that reproduces the problem.

Happy to provide any further information, asking here as this issue is still open. If I should be asking somewhere else then please redirect me to the appropriate project. Thanks.

@amaitland
Copy link

The nuspec is located at https://github.com/cefsharp/CefSharp/tree/master/NuGet/PackageReference

The packages that my example references also includes <PublishState>Included</PublishState> e.g.

<Content Include="@(CefRedist64)">
  <Link>$(CefSharpTargetDir)\%(RecursiveDir)%(FileName)%(Extension)</Link>
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  <Visible>false</Visible>
  <PublishState>Included</PublishState>
</Content>

https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2019#content claims it's a Required string. I've tested with and without and makes no difference. Adding for full disclosure in case someone looks at the packages and notices the additional entry.

@drewnoakes
Copy link
Member

I've opened dotnet/project-system#5859 to track this and will close this issue. @amaitland please take a look at that issue to ensure it covers your scenario.

@amaitland
Copy link

@drewnoakes Thanks for looking into this, greatly appreciated. I think that covers it, I'll subscribe to the new issue and provide feedback if required.

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

No branches or pull requests

5 participants