Dataverse Tip #6
Your web resource's type lives in a file you never open
The resource itself is just bytes - no type, no display name, no GUID. Everything the packer and the platform know about it is in the .data.xml file beside it.
You can edit a web resource in a solution folder for a year without opening the file that says what it is.
The resource itself is bytes. In the package it had no extension at all -
WebResources/example_form-scriptjsAEFB6A9A-0EA4-F111-B8DC-7CED8DA8A791 - and after pac solution
unpack it is example_form-script.js, a friendlier name than the format gives you. Neither name is the
type. Beside it, the unpacker writes example_form-script.js.data.xml, and the component lives there:
<WebResourceId>{aefb6a9a-0ea4-f111-b8dc-7ced8da8a791}</WebResourceId>
<Name>example_form-script.js</Name>
<DisplayName>Example form script</DisplayName>
<WebResourceType>3</WebResourceType>
WebResourceType 3 is JScript, and that number, not the extension, is what the platform reads. The
DisplayName is the name a maker sees.
Now move that sidecar out of the way and pack. The packer prints Packed Solution. and exits 0. What it
wrote is a package with three members - customizations.xml, solution.xml,
[Content_Types].xml - where the
complete one had four, and solution.xml still declares the resource:
type="61" schemaName="example_form-script.js" behavior="0"
That is a package naming a component it does not carry. Nothing in the build output says so. The file just gets 1,216 bytes smaller and a web resource stops existing.
So when a resource moves in your solution folder, the pair moves: the file and its .data.xml. A repo
that tracks one without the other still builds clean.