a collection of technical fixes and other randon stuff


  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Error message: SetParameters.xml was unexpected at this time

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



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.




Solving Error Unable to cast object of type '<>f__AnonymousType1`1[myType]' to type myType'.


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"


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?




I found that removing the new{} section of the code solved this for me.