{"data":{"markdownRemark":{"html":"<p>So, we all love the way Visual Studio 2010 allows us to debug our SharePoint code with a single bounce on the F5 button, right? Isn’t it nice the way we can deploy with confidence, knowing that we debugged our code in the dev environment? Surely, our code and configurations will act exactly the same way when we deploy them with Add-SPSolution as they do when we deploy them with F5. Right?</p>\n<p>Well then what the hell is up with this:</p>\n<p>I’m doing something that I think is pretty typical. I’ve created a content type, descended from Document, to go into a document library, like so:</p>\n<pre><code class=\"language-xml\">&#x3C;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&#x3C;Elements xmlns=\"http://schemas.microsoft.com/sharepoint/\">  \n&#x3C;!-- Parent ContentType: Document (0x0101) -->\n  &#x3C;ContentType ID=\"0x010100abd74e6994114664b1ca6a8a710ff8cb\" Name=\"Project Document\" Group=\"WMC Project Management\" Description=\"Document related to a project in the PMO portfolio.\" Inherits=\"TRUE\" Version=\"0\">  \n    &#x3C;FieldRefs>  \n      &#x3C;FieldRef ID=\"{B61A9DBA-5714-4E44-98AE-D410F84874BB}\" Name=\"PortfolioProjectName\" DisplayName=\"Portfolio Project Name\" />  \n      &#x3C;FieldRef ID=\"{811A8F99-3336-41AF-A1B1-C9DC624085C2}\" Name=\"PortfolioProjectUrl\" DisplayName=\"Portfolio Project URL\" />  \n      &#x3C;FieldRef ID=\"{938CF8E5-CCB2-49B1-91A6-595EB741F532}\" Name=\"PortfolioProjectListItemId\" DisplayName=\"Portfolio Project List Item ID\" />  \n      &#x3C;FieldRef ID=\"{9BE2CEAE-351D-4BC1-881B-44C7091FD501}\" Name=\"ProjectDocumentType\" DisplayName=\"Project Document Type\" />  \n    &#x3C;/FieldRefs>  \n  &#x3C;/ContentType>  \n&#x3C;/Elements>  \n</code></pre>\n<p>And I’ve created a document library to hold documents of this content type, like so:</p>\n<pre><code class=\"language-xml\">&#x3C;?xml version=\"1.0\" encoding=\"utf-8\"?>\n&#x3C;List xmlns:ows=\"Microsoft SharePoint\" Title=\"Project Documents\" Direction=\"$Resources:Direction;\" FolderCreation=\"TRUE\" EnableContentTypes=\"TRUE\" Url=\"PMOProjectDocuments-ProjectDocumentLibrary\" BaseType=\"1\" xmlns=\"http://schemas.microsoft.com/sharepoint/\">  \n  &#x3C;MetaData>  \n  &#x3C;ContentTypes>  \n    &#x3C;ContentTypeRef ID=\"0x010100abd74e6994114664b1ca6a8a710ff8cb\" />  \n  &#x3C;/ContentTypes>  \n  &#x3C;Fields>  \n    (blah blah blah)  \n  &#x3C;/Fields>  \n  (blah blah blah blah blah)  \n  &#x3C;/MetaData>  \n&#x3C;/List>  \n</code></pre>\n<p>So can you tell me why I see the following when I hit my F5 key?</p>\n<p><a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/5603a9809b5545da1bc9b3bad6a32184/823b0/list_info_visual_studio.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 650px;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 59.43396226415094%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7DAAAOwwHHb6hkAAABjElEQVQoz3VTCW6EMAzM/9/YSm23bNmFQMh9AFM7LC30sDRS4mNiO7bQWkMphZQyWGKMMMbAOYdSCnLOKLlU1DPp1nX9F8JaixACdpmmCZfLBVJKsM0YW8mPWJal+jLBUSphJDJnTc3s+NIuhbJin0T24Ilsnk9ke0UppXoXd+Xw3Cq0o4WyAeUUsGJ0Cc3g8TF6XEcHHfKJ0KeCiXxq1isTmoSnzqO3GXleNsdDlpL0LzLgqiJuOlW4NBPBZl8f2EUMFNBOsRKy4/76Tqh8RkNk7YPIxAIbz1UcY0QzBsrQ4W0IFFx+EQ4u45Vsr5LKpod1KEhlOfmdfplL4gw4cM/wKDOVxq1glHnF+sO+dehbK3KK9Iuefm/Ljpv7129zaVX3j53PHCvuXY/35oq+7zHQ7MkH+N7e7mg+Wtx7WeeR55Ln0FoH7z00jYscFYZxwqS3ZRA3GoW3TmMwNI8hwcf8tRGOgozbEFN+bM4GPgeaQU3kbOcz68RETe6ojx2ND4N7emz8z0044Q/7J1jWqnRvI5FyAAAAAElFTkSuQmCC'); background-size: cover; display: block;\"\n    ></span>\n    <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;box-shadow:inset 0px 0px 0px 400px white;\"\n        alt=\"List Configuration From Visual Studio\"\n        title=\"\"\n        src=\"/static/5603a9809b5545da1bc9b3bad6a32184/dbb61/list_info_visual_studio.png\"\n        srcset=\"/static/5603a9809b5545da1bc9b3bad6a32184/19bd1/list_info_visual_studio.png 163w,\n/static/5603a9809b5545da1bc9b3bad6a32184/d3bcb/list_info_visual_studio.png 325w,\n/static/5603a9809b5545da1bc9b3bad6a32184/dbb61/list_info_visual_studio.png 650w,\n/static/5603a9809b5545da1bc9b3bad6a32184/823b0/list_info_visual_studio.png 954w\"\n        sizes=\"(max-width: 650px) 100vw, 650px\"\n      />\n  </span>\n  </a></p>\n<p>Hm, that’s odd. I called my content type “Project Document” not “Project Documents.” Project Documents is the name of the document library itself. Let’s take a closer look at that content type, shall we?</p>\n<p><a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/f38fdf44996ada5cd846d69068ff97f8/5b907/content_type_visual_studio.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 650px;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 47.175141242937855%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAJCAYAAAAywQxIAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAA70lEQVQoz51S2XKEIBDk/38xD1aO2isbAUHlnN4RjIvZ5GFD0TUXDt2Mou97nI5HdF0Hay3KIsJ/l5imGWZ0kNogZWKgsc9DvJ0krjZjcMAw0wo09jmI16vBy2VEWNpXvSvwS0x/xHdffNmAg/LMMsC4VOTyZtAKVOQf8UOt+uLjLIs8zXTV1Mqsvma75I1r87Ump1zqxR9zOSfO/VCYxUzrgKkMmdZJp5Rg7Ajvw0NNqgE+xOKHyOr42cRBObzLmW8I28HlLdqGUipuarfct1VaI8a4/20+WcvFeKYb4GJuWN4/TtvA9rXIrPJOGeEGDnjDwetE7kQAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n    ></span>\n    <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;box-shadow:inset 0px 0px 0px 400px white;\"\n        alt=\"Content Type in Visual Studio\"\n        title=\"\"\n        src=\"/static/f38fdf44996ada5cd846d69068ff97f8/dbb61/content_type_visual_studio.png\"\n        srcset=\"/static/f38fdf44996ada5cd846d69068ff97f8/19bd1/content_type_visual_studio.png 163w,\n/static/f38fdf44996ada5cd846d69068ff97f8/d3bcb/content_type_visual_studio.png 325w,\n/static/f38fdf44996ada5cd846d69068ff97f8/dbb61/content_type_visual_studio.png 650w,\n/static/f38fdf44996ada5cd846d69068ff97f8/6b691/content_type_visual_studio.png 975w,\n/static/f38fdf44996ada5cd846d69068ff97f8/5b907/content_type_visual_studio.png 1062w\"\n        sizes=\"(max-width: 650px) 100vw, 650px\"\n      />\n  </span>\n  </a></p>\n<p>What the WHAT? That’s no content type, that’s a list instance! I wondered what I’d done wrong. It’s certainly not out of the question for me to screw up a SharePoint XML configuration somewhere. Hell, screwing that up is most of what I do all day. So I went to my test server, where I’d deployed a slightly different earlier version. The document library and content type appeared normal. Could there possibly be some difference in the way I deployed the project? I deployed the .wsp manually on the dev box… the very same .wsp I’d just debugged with F5.</p>\n<p><a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/bc1f0a754e13d9f79ec08e5621077ae0/f5059/list_info_manual_deploy.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 650px;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 62.153518123667375%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAAA7DAAAOwwHHb6hkAAABiElEQVQoz51S2W7bQAzU/39igQZoXLsWpL209yFNSdpJ7TTNQwkMuNxjyCVnKjkjhIBaG9iO/cC+74Kv7DiOTzFt20aEUQI25xxOr6+Y5xneewEnFPibH2O8k35MMtVawVUe94p674gxgvfH2NFbQ6M1o9aCRvGtmhsJ/2TQG04ihMp5nGaFq7IwPqPds7+ZTxWz8VhswKw3pFKfqou50luHlIvE07xVfJsjrq6g9kEZ//SDTceOlzXjZAouruJsC3KjHt/P2T12WwhfloQLXQxlPDWczcSG70vED5VkrUIVz4nfGfEwFL7AWRdf4Uv/i3DLHT9NFlwpOcel7/+c9LSGJoS/6MsmtWdCQqPBxDoEqQ356vEFptK6NP6jBP7XJqUUzucz1nWFMQZKafFaa9pTWJYV2lgEkhJrkCXFSClJ7EjHG+nTB96LRGg9LquFj0n0mB+grcOqLfkNuRTRpuiWPekxpSxnhqTH7/lssqmTZKoMRdP0OK7U9LEfT234rF/7w/De9n4DXd6qa1qhrNwAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n    ></span>\n    <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;box-shadow:inset 0px 0px 0px 400px white;\"\n        alt=\"List Configuration with Manual Deployment\"\n        title=\"\"\n        src=\"/static/bc1f0a754e13d9f79ec08e5621077ae0/dbb61/list_info_manual_deploy.png\"\n        srcset=\"/static/bc1f0a754e13d9f79ec08e5621077ae0/19bd1/list_info_manual_deploy.png 163w,\n/static/bc1f0a754e13d9f79ec08e5621077ae0/d3bcb/list_info_manual_deploy.png 325w,\n/static/bc1f0a754e13d9f79ec08e5621077ae0/dbb61/list_info_manual_deploy.png 650w,\n/static/bc1f0a754e13d9f79ec08e5621077ae0/f5059/list_info_manual_deploy.png 938w\"\n        sizes=\"(max-width: 650px) 100vw, 650px\"\n      />\n  </span>\n  </a></p>\n<p>But that looks perfectly normal. What about the content type itself?</p>\n<p><a\n    class=\"gatsby-resp-image-link\"\n    href=\"/static/b1cf883128f6d4932224e841f4d077e1/091d4/content_type_manual_deployment.png\"\n    style=\"display: block\"\n    target=\"_blank\"\n    rel=\"noopener\"\n  >\n    <span\n    class=\"gatsby-resp-image-wrapper\"\n    style=\"position: relative; display: block; margin-left: auto; margin-right: auto;  max-width: 650px;\"\n  >\n    <span\n      class=\"gatsby-resp-image-background-image\"\n      style=\"padding-bottom: 51.741293532338304%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAA7DAAAOwwHHb6hkAAABKklEQVQoz5VS2W6DMBD0//9hX9JWTWiiGIzxfU7XBkL6llga7bCCWXY8bJomDMOA0+cJnHOUXJBSQikF/dSKdw7zIcApA/HLoRcFbQwWqoH6q17tmq+CnW8C45IgDSAdsHhAhbVKV3vvHbDLqHDiFiauK+ZSH2hbl0d9DWwQFh83g6v0UD61JTc3nuvrnE3K464iIXWYUBEyEFJd0fn+fPDY+vmJb332cx2x2AxHDUPekT75Vzsan3TuXurmK9WG1r8vAcLkjUfMtkATZ0Kvq/o25vHrxwreOzhnKU7pnxVaa6S4JoGT6mxjTwQ7zx7fo8ONJrYLOKKycqU0xCxJ+IhRO1Iu8Fu0LqTxRRqWLpYJ2pPrCGmbf/mwefuwDdn586AW/J23RKTtvT/2oxDd4Rg+RwAAAABJRU5ErkJggg=='); background-size: cover; display: block;\"\n    ></span>\n    <img\n        class=\"gatsby-resp-image-image\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;box-shadow:inset 0px 0px 0px 400px white;\"\n        alt=\"Content Type with Manual Deployment\"\n        title=\"\"\n        src=\"/static/b1cf883128f6d4932224e841f4d077e1/dbb61/content_type_manual_deployment.png\"\n        srcset=\"/static/b1cf883128f6d4932224e841f4d077e1/19bd1/content_type_manual_deployment.png 163w,\n/static/b1cf883128f6d4932224e841f4d077e1/d3bcb/content_type_manual_deployment.png 325w,\n/static/b1cf883128f6d4932224e841f4d077e1/dbb61/content_type_manual_deployment.png 650w,\n/static/b1cf883128f6d4932224e841f4d077e1/6b691/content_type_manual_deployment.png 975w,\n/static/b1cf883128f6d4932224e841f4d077e1/091d4/content_type_manual_deployment.png 1005w\"\n        sizes=\"(max-width: 650px) 100vw, 650px\"\n      />\n  </span>\n  </a></p>\n<p>So… I guess this means I can’t trust content deployed through Visual Studio anymore. Hey, it’s not like I needed a streamlined workflow or anything.</p>","frontmatter":{"date":"February 06, 2012","permalink":"/2012/02/06/hey-sharepoint-why-do-you-screw-up-my-content-type-when-i-deploy-it-through-visual-studio/","title":"Hey, SharePoint: Why Do You Screw Up My Content Type When I Deploy It Through Visual Studio?","layout":"post"}}},"pageContext":{"isCreatedByStatefulCreatePages":false}}