scottdurow / SparkleXrm

An open-source library for building Dynamics CRM XRM solutions using Script#, jQuery & Knockoutjs.
MIT License
264 stars 194 forks source link

Message: Webresource name does not contain a valid prefix. #481

Open westerdaled opened 4 months ago

westerdaled commented 4 months ago

The error is

Creating Webresource '..\web-resources\js\mysolution-form.js' -> '/js/mysolution-form.js'
The application terminated with an error.
Timestamp: 25/02/2024 20:58:04
Code: -2147159784
Message: Webresource name does not contain a valid prefix.

Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

Created a Visual Studio project folder in

.\myDataverseSolution\DeployWebresources

My js files are in

.\myDataverseSolution\web-frontend\web-resources\js

My splk.json

    */
  "files": [
    {
      "uniquename": "/js/mysolution-form.js",
      "file": "..\\web-resources\\js\\mysolution-form.js",
      "description": ""
    }
  ]

My client chose the project folder for the XRm typescript files so ... I am hoping this isn't the issue 😒

westerdaled commented 4 months ago

Fortified by a decent latte, I figured out the issue:

The unique name in the spkl.json must represent the name I used in the solution ( not the name of the file).

Deployed 1 webresource(s)
Publishing 1 webresources...
Publish complete.
Processed 1 section(s)
Processed 1 config(s)
Press any key to continue . . .

I guess my one concern is I want to " auto detect" when one of my Js files has changed since last publish and only deploy if this the case.