Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/vstudio/tests/cs2005/test_files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@
]]
end

function suite.fallbackUserAction()
files { "Hello.custom" }
filter "files:Hello.custom"
buildaction "CustomAction"
prepare()
test.capture [[
<CustomAction Include="Hello.custom" />
]]
end



--
-- Files that exist outside the project folder should be added as
Expand Down
6 changes: 5 additions & 1 deletion src/tools/dotnet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@
info.action = "Page"
end
else
info.action = "None"
if fcfg.buildaction == nil then
info.action = "None"
else
info.action = fcfg.buildaction
end
end

-- Try to work out any subtypes, based on the files in the project
Expand Down
4 changes: 3 additions & 1 deletion website/docs/buildaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For C/C++, `action` is the name of the MSBuild action as defined by the vcxproj
| Copy | Copy the file to the target directory. |

For C# projects, `buildaction` behaviour is special to support legacy implementation.
In C#, `action` is one of
In C#, `action` can be one of

| Action | Description |
|-------------|-----------------------------------------------------------------------|
Expand All @@ -38,6 +38,8 @@ In C#, `action` is one of
| Resource | Copy/embed the file with the project resources. |
| UserControl | Treat the source file as [visual user control][2]. |

If not matched by any of the above, the Action falls back to using the given action name verbatim (with no SubType). This allows project specific user defined custom BuildActions to be specified.

The descriptive actions such as **Component**, **Form*, and **UserControl** are only recognized by Visual Studio, and may be considered optional as Visual Studio will automatically deduce the types when it first examines the project. You only need to specify these actions to avoid unnecessary modifications to the project files on save.

### Applies To ###
Expand Down
Loading