-
Notifications
You must be signed in to change notification settings - Fork 386
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
Project System: AvailableItemName support #113
Comments
For some reason my |
Adding back link to duped feedback: https://developercommunity.visualstudio.com/content/problem/31240/additional-build-actions-for-netstandard-library-p.html |
|
This functionality is necessary to make it possible to do things like copy files to the output directory, which laughably, are impossible in Visual Studio without resorting to batch files (or a post build event which is a batch file by another name). E.g. You have a project subdirectory 'Libs' containing binary dependencies, you want that output to your output directory. If you just select build type 'Content' and 'Copy to output directory' it will end up in $(OutDir)/Libs where your binary dependencies will not be resolved. The 'fix' was to add this to your project file:
...which enabled you to mark the files as 'RootContent' whereupon they would get copied to the output directory. Now even this hack of a workaround is broken with no mention of an alternative. How do I copy files to my output directory now? |
This is compounded by the fact that build events are now completely broken too as project environment variables are not expanded, so even using a batch file is now impossible either. Honestly the Dotnet Core / VS2017 tooling is an absolute train wreck. |
@Neutrino-Sunset the easiest way to do that is with something like this:
I consider build events a super old legacy thing that was brought forward for backs compat mostly, but using built-in MSBuild constructs everything is extremely easy. For example, the elements above automatically integrate with clean, incremental build/copy, etc., without you having to do anything. And also, it works all the way back to the earliest MSBuild versions, nothing to do with .NET Core or VS2017 honestly. |
That doesn't work either. Firstly it ouputs the Libs directory to the output directory even though the TargetPath '%(Filename)%(Extension)' should not do this. Secondly it doesn't delete the Libs directory when you clean the project. This does work, although it's not pretty and it took time to work out that I'd rather have spent doing something useful.
Thanks for putting me on a useful track though. |
📝 When implementing this feature, the following should be verified:
|
|
@davkean 2 is really the important item. If 1 is a "must" for some particular project, they can just use |
Is it possible to see in solution explorer currently items with non-standard type? At least on VS 2017.4, adding to PropertyGroup |
@iskiselev To turn on the capability you add the following: <ItemGroup>
<ProjectCapability Include="ShowMissingItemTypes" />
</ItemGroup> Note that this is an experimental feature. |
Changes to enable AvailableItemName support in CPS are in progress (Internal PR). An additional PR will be created to finalize support in this repo once that is complete. |
…528.1 (dotnet#113) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19278.1
csproj/msvbproj supports
<AvailableItemName>
to allow adding to the choice of Build Actions. We should enable them to be dynamically added (such as via a NuGet package) and the project should be able to pick them up without a reload.Update: Make sure we keep C++ in the loop, while the feature will automatically work for them in non-cached mode, their cached mode will need to be updated to handle it.
The text was updated successfully, but these errors were encountered: