When deploying an MVC website to Windows Server, via the publish /MSDeploy technique, you may come across the error:
SetParameters.xml was unexpected at this time
Solution:
This is down to invalid characters in the folder name that you are deploying from. eg: spaces or parentheses.
In my case, i had saved two copies of the deploy and was installing from folder "Deploy (2)"
To fix, this simply rename the folder so there are no spaces of parentheses in the path and retry the deployment script.
Problem
When coding in MVC , i Came across this or similar error message:
"Unable to cast object of type '<>f__AnonymousType1`1[myType]' to type myType"
Background
I had been getting used to wrapping parameters in new{} when passing data from the controller to the view.
This error message was saying, i can't convert you class to your class. The new{} statement wrapping my object was changing it to an 'anonymous type'. So how did i fix it?
Solution...
I found that removing the new{} section of the code solved this for me.