1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / The type String cannot be constructed. You must configure the container to supply this value.

The type String cannot be constructed. You must configure the container to supply this value.

6 posts, 0 answered
  1. Michael
    Michael avatar
    18 posts
    Registered:
    26 Jan 2011
    22 Feb 2011
    Link to this post
    Well, I'm not sure how all my issues started but right now I am not able to fully run my Sitefinity development project. So much has happened since my first error that it will be very difficult to explain how I actually got to this point. What I can say is that right now I'm getting the error "The type String cannot be constructed. You must configure the container to supply this value." I'm sure it has something to do with the configuration files in my project.

    At some point I starting getting errors like "invalid characters in Line 1 - position 1", and a few others that I can't remember off hand. Searching for these issues on Sitefinity forum posts led me to focus on the configuration files. After researching my configuration files I found that two of my configuration files: ContentViewContent.config and PublishingConfig.Config were completely empty. I compared these files with similar files from other projects and those other files were not empty. Not knowing if this is what I should do or not, I replaced the two empty config files with the ones I found that actually had something.

    The good news is, I got passed all my errors and I am now able to load the project's administrator. The bad news is I cannot click into either the Pages or Design | Page Templates. When I do I get the error above.

    I'm sure there is some sort of disconnect between the configuration files and the database. If there is, is this something that I can manually correct either by changing something directly in the database or in the configuration files?

    Thanks,
    Michael
  2. Michael
    Michael avatar
    18 posts
    Registered:
    26 Jan 2011
    23 Feb 2011
    Link to this post
    After much of this and that, I ended up uninstalling Sitefinity and all Telerik RadControls and re-installing from scratch. After re-installing, everything started working. I'm sure something I did triggered this to happen but what that was I do not know. I guess another of my concerns is that whatever disconnect existed, there's wasn't much available to me that identified what I could do to correct my issue.

    Anyway, I'm back up so if this happens again, I'll be sure to try to remember what triggers this so I can pass the issue along to these groups.

    Thanks,
    Michael
  3. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Feb 2011
    Link to this post
    Hello Michael,

    Configuration files in the App_Data/Sitefinity/Configuration are connected to the database schema you are using on your website. In the event that your configuration files lost their content and you have tried to restore them from another website the The type String cannot be constructed. You must configure the container to supply this value." error starts appearing as the module configrations do not match the database schema on your site.

    Regards,
    Radoslav Georgiev
    the Telerik team
  4. Michael
    Michael avatar
    18 posts
    Registered:
    26 Jan 2011
    01 Mar 2011
    Link to this post
    Is there any documentation on how the configurations files relate to the database schema? I ask in cases where the configuration files may need to be reconstructed manually? In my case, I did nothing directly (intentionally, that is) to remove or otherwise empty the content of those two configuration files. But, my site became worthless once those files were altered. Granted, I wasn't much into my project to begin with but this would be a nightmare if it happened once a project is well enough along.

    Thanks,
    Michael
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Mar 2011
    Link to this post
    Hi Michael,

    There is no documentation that explains each config file, but I will give you an example for the SecurityConfig.

    <securityConfig validationKey="908736608326FA038CFB390DE39618E23B7D22EEE76844C575C7069F617FA6162DA68B483F42BD19B17961EDBDCA51CF2BD4F6EA3B820B1D2CB6E99970C5263E" decryptionKey="9DB4CC1E1F6416673EE59E390380FCC84DD245E988B30FDCDE3A2AB970DE7A1D" xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="4.0.4080.16853">

    Here you can see two keys - valildation and decription. We use these keys to validate
    the password and then decrypt it for each project. If you change the keys you will not be able to login.

    Greetings,
    Ivan Dimitrov
    the Telerik team
  6. Michael
    Michael avatar
    18 posts
    Registered:
    26 Jan 2011
    04 Mar 2011
    Link to this post
    Thanks Ivan,

    That makes perfect sense and I use similar methods in my own projects. But my concern now is, if those keys should ever be modified for whatever reason, not that they should of course, but I tend to think in "worse case scenarios", does it render the database utterly worthless?

    I wouldn't be surprised if it did, so I guess in this case, back ups are your best friend.

    Michael
6 posts, 0 answered