How to add a custom assembly action to a list in Visual Studio?

If you display the properties for a project element in Visual Studio, in the "Advanced" category, there is the "Create Action" property. In my Visual Studio installation, it contains "None", "Compile", "Content", etc.

If I try to enter an unrecognized value in the field, I will get a warning "Property value is invalid."

Can I add my own values ​​to this list? If so, how?

I am not asking how to add custom assembly types to the MSBuild project file - I already know how to do this. It's just that I'm too lazy to "Unload the project" / "Edit the project" / change <None Include="Foo.bar"/> to <Whatever Include="Foo.bar"/> / "Update the project" / " Yes, I'm sure I want to reload the project, even if it’s already open in the editor. "

+4
source share
1 answer

Accordingly , create the following elements in the csproj file (or in the imported .targets file):

 <ItemGroup> <AvailableItemName Include="Whatever" /> </ItemGroup> 

You should see another option on the list.

+7
source

Source: https://habr.com/ru/post/1439331/


All Articles