[{"data":1,"prerenderedAt":211},["ShallowReactive",2],{"article-change-silverlight-class-library-to-application":3},{"article":4,"tags":61,"previous":76,"next":124},{"id":5,"title":6,"author":7,"body":8,"createdAt":49,"description":50,"extension":51,"img":52,"meta":53,"navigation":54,"path":55,"seo":56,"stem":57,"tags":58,"updatedAt":49,"__hash__":60},"articles\u002Farticles\u002Fchange-silverlight-class-library-to-application.md","Change Silverlight Class Library to Application","[object Object]",{"type":9,"value":10,"toc":45},"minimark",[11,15,23,33,36,39,42],[12,13,14],"p",{},"Add New Item to the Silverlight Class project > Silverlight Application Class (This adds app.xaml, app.xaml.cs files)",[12,16,17,18,22],{},"Open the class library project file and change ",[19,20,21],"silverlight-application",{},"false","\nto true (Unload the class library project and edit the csproj file)",[12,24,25,26],{},"Add new element XapOutputs to project file below the element",[19,27,28,29],{}," i.e. add ",[30,31,32],"xap-outputs",{},"true",[12,34,35],{},"Now open Project Properties of the Silverlight Class library and change to the > Silverlight tab > Change the starter object",[12,37,38],{},"Change the following Project Property > Silverlight tab > Set the Xap file name",[12,40,41],{},"In the related web application add project property > Silverlight tab > Add your Silverlight application",[12,43,44],{},"You have not changed a Silverlight class library to an application project where the xap will be output and copied to the respective web site ClientBin directory.",{"title":46,"searchDepth":47,"depth":47,"links":48},"",2,[],"2015-04-20T08:07:13.8700000-04:00","Changing class library type to application.","md","\u002Farticles\u002Fimages\u002Fm8gdjJD1VK.png",{},true,"\u002Farticles\u002Fchange-silverlight-class-library-to-application",{"title":6,"description":50},"articles\u002Fchange-silverlight-class-library-to-application",[59],"silverlight","u_COjDxXgW8q1CXFUEeyO_rqVp2EzKopDX8j3mKRw2Y",[62],{"id":63,"title":64,"body":65,"description":69,"extension":51,"img":70,"meta":71,"name":59,"navigation":54,"path":72,"seo":73,"stem":74,"__hash__":75},"tags\u002Ftags\u002Fsilverlight.md","Silverlight",{"type":9,"value":66,"toc":67},[],{"title":46,"searchDepth":47,"depth":47,"links":68},[],"Say no more.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fsilverlight",{"description":69},"tags\u002Fsilverlight","aLtzOSbx2leBhX5c__fGG4ZcqRvHO7p9rZCpLvRA0Bw",{"id":77,"title":78,"author":7,"body":79,"createdAt":113,"description":114,"extension":51,"img":115,"meta":116,"navigation":54,"path":117,"seo":118,"stem":119,"tags":120,"updatedAt":113,"__hash__":123},"articles\u002Farticles\u002Fnet-4-new-gac-locations-gacutil.md",".NET 4 New GAC Locations\u002FGacUtil",{"type":9,"value":80,"toc":111},[81,84,87,90,93,96,99,102,105,108],[12,82,83],{}," This is what I know, let me know if you know otherwise.  There are now 2 distinct GAC locations that you have to manage as of the .NET 4 Framework release.",[12,85,86],{},"The GAC was split into two, one for each CLR (2.0, 3.5 AND 4.0).  The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0. To avoid issues between CLR 2.0 and CLR 4.0 , the GAC is now split into private GAC’s for each runtime.  The main change is that CLR v2.0 applications now cannot see CLR v4.0 assemblies in the GAC.",[12,88,89],{},"In previous .NET versions, when I installed a .NET assembly into the GAC (using gacutil.exe or even drag and drop to the c:\\windows\\assembly directory), I could find it in the ‘C:\\Windows\\assembly’ path.",[12,91,92],{},"With .NET 4.0, GAC is now located in the 'C:\\Windows\\Microsoft.NET\\assembly’ path.",[12,94,95],{},"In order to install a dll to the .NET 4 GAC it is necessary to use the gacutil found C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bin\\GacUtil.exe  In addition, you can no longer use the drag n' drop (in reality the drag n' drop really executed the gacutil via a windows explorer extension).",[12,97,98],{},"After you use the gacutil.exe -i {path to dll} you can view that it is indeed in the gac via gacutil -l (which will list all dlls in the gac).  I used this command and piped the results to a text file via > out.txt which made it easier to find the recently added component.",[12,100,101],{},"I was not able to see my gac object in the directory for .net 4 (i.e. c:\\windows\\microsoft.net\\assembly path).  I am not sure why just yet.  Ideas?",[12,103,104],{},"At this point, the object is in the local gac however if you are using vs.net 2010 it will still not show up in the list of references. To get the component to show up in the VS.NET list of references can add a registry entry to HKLM\\SOFTWARE\\WOW6432Node\\Microsoft.NETFramework\\v4.0.30319\\AssemblyFoldersEx  At this point, the component is in the local GAC and is in the list of references to be used by vs.net.",[12,106,107],{},"Note, I did find that if I just added the path to the registry without adding it to the gac it was available to vs.net.  So, because the component is listed via vs.net add references it does not necessarily mean it is in the gac.",[12,109,110],{},"What still confuses me is that I am still unable to view my recently added component in the .NET 4 directories above.  Ideas?",{"title":46,"searchDepth":47,"depth":47,"links":112},[],"2015-04-20T08:07:14.0800000-04:00","There are now 2 distinct GAC locations that you have to manage as of the .NET 4 Framework release...","\u002Farticles\u002Fimages\u002Fggb4dMDcZM.png",{},"\u002Farticles\u002Fnet-4-new-gac-locations-gacutil",{"title":78,"description":114},"articles\u002Fnet-4-new-gac-locations-gacutil",[121,122],"aspnet","enterpriselibrary","2K_K7LqZ6HZ_OhbA_zCui0-ixHdV9XtLRHPoIkAcdss",{"id":125,"title":126,"author":7,"body":127,"createdAt":203,"description":204,"extension":51,"img":199,"meta":205,"navigation":54,"path":206,"seo":207,"stem":208,"tags":209,"updatedAt":203,"__hash__":210},"articles\u002Farticles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error.md","Element is already the child \u002F System.Windows.Markup.XamlParseException --> PivotControl Error",{"type":9,"value":128,"toc":201},[129],[12,130,131,132,135,136,138,139,135,141,143,144,148,149,152,154,155,157,158,160,161,163,164,166,167,169,170,135,172,135,174,176,177,135,179,181,182,135,184,186,187,135,189,191,192,135,194,196],{},"I have been working with Silverlight PivotViewer control and recently came across problem with the display of the control. \nI have a solution with multiple projects one of which is a Silverlight application.  Everything would compile without any error. \nWhen browsing to the form\u002Fpage with the control I would immediately get an exception on the InitializeComponent(); method within the Silverlight UserControl. \nThis method is called before loading any pivot cxml data.",[133,134],"br",{},"\n ",[133,137],{},"\nI have seen this component through odd errors or fail to load when there is javascript errors on the page or a failure of any ajax method. \nThe error that is thrown is as follows…",[133,140],{},[133,142],{},"\n{System.Windows.Markup.XamlParseException: Set property 'System.Windows.FrameworkElement.Style' threw an exception. ",[145,146,147],"span",{},"Line: 15 Position: 43"," ---> System.Windows.Markup.XamlParseException: Element is already the child of another element. ",[145,150,151],{},"Line: 0 Position: 0",[133,153],{},"\n   at MS.Internal.XcpImports.CreateFromXaml(UnmanagedMemoryStream stream, String sourceAssemblyName, Boolean createNamescope, Boolean requireDefaultNamespace, Boolean allowEventHandlers)",[133,156],{},"\n   at System.Windows.Controls.Control.GetBuiltInStyle(IntPtr nativeTarget, IntPtr& nativeStyle)",[133,159],{},"\n   --- End of inner exception stack trace ---",[133,162],{},"\n   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)",[133,165],{},"\n   at PivotView.Viewer.InitializeComponent()",[133,168],{},"\n   at PivotView.Viewer..ctor()}",[133,171],{},[133,173],{},[133,175],{},"\nIf searching Google you will see a number of posts on errors surrounding ‘XamlParseException’, ‘Styles’, ‘Element is already the child’ etc.  Without help from these posts, I finally came across the solution.  I found the error was the result of some missing references in the Silverlight project.  The components missing can be found in C:\\Program Files (x86)\\Microsoft SDKs\\Silverlight\\v4.0\\Toolkit\\Apr10\\Bin (which is installed as part of the most recent Silverlight Toolkit).  References to the following components was necessary.",[133,178],{},[133,180],{},"\nSystem.Windows.Controls.Layout.Toolkit.dll\nSystem.Windows.Controls.Toolkit.dll\nSystem.Windows.Controls.Toolkit.Internals.dll",[133,183],{},[133,185],{},"\nIf you're having issues, rename the xap file (adding .zip) and take a look to ensure those dlls are included.",[133,188],{},[133,190],{},"\nI thought I would post this information for others as well as a reminder to myself.  If you have any questions, let me know.",[133,193],{},[133,195],{},[197,198],"img",{"src":199,"alt":46,"style":200},"\u002Farticles\u002Fimages\u002Fpivotviewer.jpg","display:none;",{"title":46,"searchDepth":47,"depth":47,"links":202},[],"2015-04-20T08:07:13.7700000-04:00",null,{},"\u002Farticles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error",{"title":126,"description":204},"articles\u002Felement-is-already-the-child-system-windows-markup-xamlparseexception-pivotcontrol-error",[59],"MwzE74POWqzTSnbetCRmaz5deTYzJG440Jb4tLUMo7w",1781574766867]