Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bear 40 posts 129 karma points
    Apr 09, 2013 @ 11:49
    Bear
    0

    Unable to cast object of type 'Umbraco.Forms.Core.FieldSetting.Password' to type 'Umbraco.Forms.Core.FieldType'.

    Just trying to get started with  "Login" from http://www.nibble.be/?p=205  (I'm using Contour 3.0.9 and Umbraco 4.11.5)

    From this line; Type = typeof(Password)

    [Field("Login", "",
           Type = typeof(Password),
           Mandatory = true)]
          public string Password { get; set; }

    I'm getting this error

    Unable to cast object of type 'Umbraco.Forms.Core.FieldSetting.Password' to type 'Umbraco.Forms.Core.FieldType'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.InvalidCastException: Unable to cast object of type 'Umbraco.Forms.Core.FieldSetting.Password' to type 'Umbraco.Forms.Core.FieldType'.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace: 

    [InvalidCastException: Unable to cast object of type 'Umbraco.Forms.Core.FieldSetting.Password' to type 'Umbraco.Forms.Core.FieldType'.]

       Umbraco.Forms.CodeFirst.FormManager.SynchronizeForm(Type typeForm) in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\FormBuilder\FormManager.cs:382

       Umbraco.Forms.CodeFirst.FormManager.SynchronizeForms() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\FormBuilder\FormManager.cs:201

       Umbraco.Forms.CodeFirst.FormManager.Synchronize() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\FormBuilder\FormManager.cs:24

       Umbraco.Forms.CodeFirst.UmbracoManager.Synchronize() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\UmbracoManager.cs:36

       Umbraco.Forms.CodeFirst.UmbracoManager.SynchronizeIfNotSynchronized() in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\UmbracoManager.cs:21

       Umbraco.Forms.CodeFirst.ContourFormBuilderHttpModule.context_BeginRequest(Object sender, EventArgs e) in c:\Program Files (x86)\teamcity\buildAgent\work\fdc2f0fcbbcef310\Umbraco.Forms.CodeFirst\ContourFormBuilderHttpModule.cs:27

       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80

       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

     

  • Comment author was deleted

    Apr 09, 2013 @ 13:21

    Yeah Umbraco.Forms.Core.FieldSetting.Password isn't a fieldtype but a fieldsetting type (when adding settings to custom fieldtypes)

    Try Umbraco.Forms.Core.Providers.FieldTypes.Password instead (all of the default fieldtypes should be in Umbraco.Forms.Core.Providers.FieldTypes)

  • Bear 40 posts 129 karma points
    Apr 09, 2013 @ 13:59
    Bear
    0

    Thanks Tim, I've gone a different route now though.

Please Sign in or register to post replies

Write your reply to:

Draft