Closed cveld closed 8 years ago
Please just use one Site
element with multiple Files
elements. That is an array. See the sample:
"Files": [
{
"Source": "dist\\js",
"Destination": "/js"
},
{
"Source": "dist\\css",
"Destination": "/css"
}
]
I see you are proposing a workaround by putting javacripts and css-files in separate folders. Ideally we just keep all files in one flat folder. Currently this is not possible with one Site
element given the exception.
(using 1.2.4)
Well, you can also do this:
"Files": [
{
"Source": "dist\\allmyfiles",
"Destination": "/js",
"Include": ".*.js"
},
{
"Source": "dist\\allmyfiles",
"Destination": "/css",
"Include": ".*.css"
}
]
Have you tried yourself? I checked the source code and was assuming that the Source-value is used to generate the key for the watcher-object. And due to reuse of the same key the mentioned exception is generated:
Stop Error: System.ArgumentException: An item with the same key has already been
added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boo
lean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at SPDeployment.Deployer.RegisterWatchTask(DeploymentSite site)
at SPDeployment.Deployer.Deploy(String name, String environment, Boolean watc
h)
I have a configuration file with two "Sites" which point both to the same site, and both to the same source-directory. The difference is:
Unfortunately the current version of the tool uses the value of the source-directory as the key for the filewatchers collection. This results in the following exception: