[{"data":1,"prerenderedAt":403},["ShallowReactive",2],{"article-the-type-object-is-defined-in-an-assembly-that-is-not-referenced-you-must-add-a-reference-to-assembly-mscorlib-version-2-0-5-0":3},{"article":4,"tags":238,"previous":253,"next":354},{"id":5,"title":6,"author":7,"body":8,"createdAt":228,"description":229,"extension":230,"img":27,"meta":231,"navigation":60,"path":232,"seo":233,"stem":234,"tags":235,"updatedAt":228,"__hash__":237},"articles\u002Farticles\u002Fthe-type-object-is-defined-in-an-assembly-that-is-not-referenced-you-must-add-a-reference-to-assembly-mscorlib-version-2-0-5-0.md","The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0","[object Object]",{"type":9,"value":10,"toc":226},"minimark",[11,15,30,169,172,175,222],[12,13,14],"p",{},"Another day, another issue while building a Xamarin project. In this case, I was building a project from Xamarin and working through some logic. When building the Android project I was presented with the following build errors. I am getting use to different errors at the most unexpected times. This issue was not unlike others that I have come up against with my cross-device mobile development efforts. The good news, after much hunting and packing I found the solution. See below.",[12,16,17],{},[18,19,21],"a",{"href":20},"\u002Farticles\u002Fimages\u002Fopen-live-writer-6b25ff33673e_d99f-image_5.png",[22,23],"img",{"title":24,"style":25,"border":26,"alt":24,"src":27,"width":28,"height":29},"image","border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px",0,"\u002Farticles\u002Fimages\u002Fopen-live-writer-6b25ff33673e_d99f-image_thumb_1.png",657,458,[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-html shiki shiki-themes github-light github-dark","Severity Code Description Project File Line Suppression State\nError CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral,\n\nPublicKeyToken=7cec85d7bea7798e'. GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0234 The type or namespace name 'TargetFrameworkAttributeAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?) GreatQuotes.Android\n\nC:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0234 The type or namespace name 'TargetFrameworkAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?) \nGreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0246 The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?) GreatQuotes.Android\n\nC:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.Object' \nis not defined or imported \nGreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\nError CS0518 Predefined type 'System.Void' is not defined or imported GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0012 The type 'Object' is defined in an assembly that is not referenced. \n\nYou must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\n\nError CS0246 The type or namespace name 'Icon' could not be found (are you missing a using directive or an assembly reference?) GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0518 Predefined type 'System.Object' is not defined or imported GreatQuotes.Android \n\nC:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\nError CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 \n\nResources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.\nGreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active  \n","html","",[38,39,40,49,55,62,68,73,79,85,90,96,102,108,114,119,125,130,136,141,147,153,158,164],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sVt8B","Severity Code Description Project File Line Suppression State\n",[41,50,52],{"class":43,"line":51},2,[41,53,54],{"class":47},"Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral,\n",[41,56,58],{"class":43,"line":57},3,[41,59,61],{"emptyLinePlaceholder":60},true,"\n",[41,63,65],{"class":43,"line":64},4,[41,66,67],{"class":47},"PublicKeyToken=7cec85d7bea7798e'. GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0234 The type or namespace name 'TargetFrameworkAttributeAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?) GreatQuotes.Android\n",[41,69,71],{"class":43,"line":70},5,[41,72,61],{"emptyLinePlaceholder":60},[41,74,76],{"class":43,"line":75},6,[41,77,78],{"class":47},"C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0234 The type or namespace name 'TargetFrameworkAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?) \n",[41,80,82],{"class":43,"line":81},7,[41,83,84],{"class":47},"GreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0246 The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?) GreatQuotes.Android\n",[41,86,88],{"class":43,"line":87},8,[41,89,61],{"emptyLinePlaceholder":60},[41,91,93],{"class":43,"line":92},9,[41,94,95],{"class":47},"C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Users\\dyardy\\AppData\\Local\\Temp\\MonoAndroid,Version=v7.1.AssemblyAttributes.cs 4 ActiveError CS0518 Predefined type 'System.Object' \n",[41,97,99],{"class":43,"line":98},10,[41,100,101],{"class":47},"is not defined or imported \n",[41,103,105],{"class":43,"line":104},11,[41,106,107],{"class":47},"GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\n",[41,109,111],{"class":43,"line":110},12,[41,112,113],{"class":47},"Error CS0518 Predefined type 'System.Void' is not defined or imported GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0012 The type 'Object' is defined in an assembly that is not referenced. \n",[41,115,117],{"class":43,"line":116},13,[41,118,61],{"emptyLinePlaceholder":60},[41,120,122],{"class":43,"line":121},14,[41,123,124],{"class":47},"You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\n",[41,126,128],{"class":43,"line":127},15,[41,129,61],{"emptyLinePlaceholder":60},[41,131,133],{"class":43,"line":132},16,[41,134,135],{"class":47},"Error CS0246 The type or namespace name 'Icon' could not be found (are you missing a using directive or an assembly reference?) GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0518 Predefined type 'System.Object' is not defined or imported GreatQuotes.Android \n",[41,137,139],{"class":43,"line":138},17,[41,140,61],{"emptyLinePlaceholder":60},[41,142,144],{"class":43,"line":143},18,[41,145,146],{"class":47},"C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 Resources\\Start\\GreatQuotes.Android\\App.cs 9 Active\n",[41,148,150],{"class":43,"line":149},19,[41,151,152],{"class":47},"Error CS0518 Predefined type 'System.String' is not defined or imported GreatQuotes.Android C:\\Xamarin\\10a_xam300\\Lab Materials\\Part 01 \n",[41,154,156],{"class":43,"line":155},20,[41,157,61],{"emptyLinePlaceholder":60},[41,159,161],{"class":43,"line":160},21,[41,162,163],{"class":47},"Resources\\Start\\GreatQuotes.Android\\App.cs 9 ActiveError CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.\n",[41,165,167],{"class":43,"line":166},22,[41,168,107],{"class":47},[12,170,171],{},"The solution (to make a very long story short) was to unload the project from Visual Studio. Open the csproj and add the following reference (in bold). I initially was comparing some of my working Android projects with this one that just would not build.",[12,173,174],{},"I noticed the reference to mscorlib. I tried to add a reference to this dll directly through ‘Add Reference’ but I got the following error \"mscorlib.dll\" component is already automatically referenced. The build system should add this reference for you.  Since I could not add through the VS.NET interface, i chose to add via csproj file. After reloading the project and rebuilding the reference to mscorlib was visible in the list of references and finally my project built fine.",[31,176,180],{"className":177,"code":178,"language":179,"meta":36,"style":36},"language-xml shiki shiki-themes github-light github-dark","\u003CItemGroup> \n    \u003CReference Include=\"Mono.Android\" \u002F>\n    \u003CReference Include=\"mscorlib\" \u002F>\n    \u003CReference Include=\"System\" \u002F> \n    \u003CReference Include=\"System.Xml\" \u002F> \n    \u003CReference Include=\"System.Core\" \u002F> \n    \u003CReference Include=\"System.Xml.Linq\" \u002F>\n\u003C\u002FItemGroup>\n","xml",[38,181,182,187,192,197,202,207,212,217],{"__ignoreMap":36},[41,183,184],{"class":43,"line":44},[41,185,186],{},"\u003CItemGroup> \n",[41,188,189],{"class":43,"line":51},[41,190,191],{},"    \u003CReference Include=\"Mono.Android\" \u002F>\n",[41,193,194],{"class":43,"line":57},[41,195,196],{},"    \u003CReference Include=\"mscorlib\" \u002F>\n",[41,198,199],{"class":43,"line":64},[41,200,201],{},"    \u003CReference Include=\"System\" \u002F> \n",[41,203,204],{"class":43,"line":70},[41,205,206],{},"    \u003CReference Include=\"System.Xml\" \u002F> \n",[41,208,209],{"class":43,"line":75},[41,210,211],{},"    \u003CReference Include=\"System.Core\" \u002F> \n",[41,213,214],{"class":43,"line":81},[41,215,216],{},"    \u003CReference Include=\"System.Xml.Linq\" \u002F>\n",[41,218,219],{"class":43,"line":87},[41,220,221],{},"\u003C\u002FItemGroup>\n",[223,224,225],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":227},[],"2017-02-12T08:38:11.7100000-05:00","This issue was not unlike others that I have come up against with my cross-device mobile development efforts.","md",{},"\u002Farticles\u002Fthe-type-object-is-defined-in-an-assembly-that-is-not-referenced-you-must-add-a-reference-to-assembly-mscorlib-version-2-0-5-0",{"title":6,"description":229},"articles\u002Fthe-type-object-is-defined-in-an-assembly-that-is-not-referenced-you-must-add-a-reference-to-assembly-mscorlib-version-2-0-5-0",[236],"xamarin","RHG4SC8nF4gbrv4fVY5o1UgRK9wxXwly9sZS5lhbuJA",[239],{"id":240,"title":241,"body":242,"description":246,"extension":230,"img":247,"meta":248,"name":236,"navigation":60,"path":249,"seo":250,"stem":251,"__hash__":252},"tags\u002Ftags\u002Fxamarin.md","Xamarin",{"type":9,"value":243,"toc":244},[],{"title":36,"searchDepth":51,"depth":51,"links":245},[],"Xamarin is an open-source platform for building modern and performant applications for iOS, Android, and Windows with . NET. Xamarin is an abstraction layer that manages communication of shared code with underlying platform code.","https:\u002F\u002Fimages.unsplash.com\u002Fphoto-1598313183973-4effcded8d5e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80",{},"\u002Ftags\u002Fxamarin",{"description":246},"tags\u002Fxamarin","deVB66I7cJMtWvqybFh5POf9LBCBwHNe-5ZGMOzV5G4",{"id":254,"title":255,"author":7,"body":256,"createdAt":346,"description":347,"extension":230,"img":268,"meta":348,"navigation":60,"path":349,"seo":350,"stem":351,"tags":352,"updatedAt":346,"__hash__":353},"articles\u002Farticles\u002Fno-ios-simulator-or-device-appear-on-visual-studio.md","No IOS simulator or device appear on Visual Studio",{"type":9,"value":257,"toc":344},[258,271,278,280,293,296,306,323,331,334],[12,259,260],{},[18,261,264],{"style":262,"href":263},"display: none","\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-xamarinios_2.png",[22,265],{"title":266,"style":267,"border":26,"alt":266,"src":268,"width":269,"height":270},"xamarinios","border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px","\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-xamarinios_thumb.png",147,128,[12,272,273,274],{},"Ok, once again – I open a Xamarin Forms app, ensure I have the latest Xamarin Forms version in each of the PCL, Android and IOS projects. The project rebuild works for the PCL and Android projects and fails for the IOS. The error… ",[275,276,277],"em",{},"No valid iOS code signing keys found in keychain.",[275,279],{},[12,281,282,292],{},[275,283,284,285,288],{},"You need to request a codesigning certificate from\n",[18,286],{"href":287},"https:\u002F\u002Fdeveloper.apple.com",[18,289,287],{"href":287,"rel":290},[291],"nofollow"," What’s going on…I first look to ensure my Mac agent is connected yep, perform a clean and rebuild of each project..same error. The solution for me…. Open the dialog “Xamarin Mac Agent” – right click on the connect Mac – choose ‘Disconnect’. After disconnection – select the Mac and ‘Connect’…waiting (aha …it won’t connect, this could be the problem) Nope – didn’t think it would be this easy. I was able to use the ‘show simulator’ option within vs.net and the simulator popped open on the Mac. I opened another project to see if this issue was related to the specific project. Nope. The 2nd project I opened had the same issue, where in the ‘Device’ list the was no option for ‘iphone simulator’.",[12,294,295],{},"I then proceed to open Xamarin Studio on the Mac (currently I am using the Beta channel as this was necessary to work with Visual Studio 2017). There is an update and it started to download. Here is to more hope that this solves the issue.",[12,297,298],{},[18,299,301],{"href":300},"\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-image_2.png",[22,302],{"title":24,"style":25,"border":26,"alt":24,"src":303,"width":304,"height":305},"\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-image_thumb.png",229,160,[12,307,308,309,314,315],{},"This update on the Mac will move it up to ",[18,310,313],{"href":311,"target":312},"https:\u002F\u002Freleases.xamarin.com\u002Frelease-candidate-cycle-9-rc6-refresh\u002F","_blank","Xamarin Studio 6.2.0"," I tried to find the IOS Simulator after this update. Still nothing. I removed all mac agents, restarted vs.net 2017 a couple times, still nothing. I opened up another project and magically this time the ‘iphone simulator’ option was available. Why…no idea..(this product is going to kill me)\n",[18,316,318],{"href":317},"\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-image_4.png",[22,319],{"title":24,"style":25,"border":26,"alt":24,"src":320,"width":321,"height":322},"\u002Farticles\u002Fimages\u002Fimages\u002Fopen-live-writer-i_c801-image_thumb_1.png",479,36,[12,324,325,326,330],{},"So now I am thinking there is a difference between the 2 projects. Why would I have the simulator option in one but not the other? This is really messed up. So I open the project that does not have the ‘iphonesimulator’ option, I can see within Configuration Manager that this option exists ",[327,328,329],"strong",{},"and ","I can connect, build, deploy to Mac simulator.",[12,332,333],{},"Well this scenario is new to me…no idea.",[12,335,336],{},[18,337,339],{"href":338},"\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-image_6.png",[22,340],{"title":24,"style":25,"border":26,"alt":24,"src":341,"width":342,"height":343},"\u002Farticles\u002Fimages\u002Fopen-live-writer-i_c801-image_thumb_2.png",240,171,{"title":36,"searchDepth":51,"depth":51,"links":345},[],"2017-02-18T08:07:02.3200000-05:00",null,{},"\u002Farticles\u002Fno-ios-simulator-or-device-appear-on-visual-studio",{"title":255,"description":347},"articles\u002Fno-ios-simulator-or-device-appear-on-visual-studio",[236],"4n4VwoebArTKwJ97QT4guPzoyBnHAnofJjW9sIKPOVM",{"id":355,"title":356,"author":7,"body":357,"createdAt":396,"description":347,"extension":230,"img":392,"meta":397,"navigation":60,"path":398,"seo":399,"stem":400,"tags":401,"updatedAt":396,"__hash__":402},"articles\u002Farticles\u002Funable-to-start-build-4-3-0-664-agent-when-building-ios-apps.md","Unable to start Build 4.3.0.664 agent. when building iOS apps",{"type":9,"value":358,"toc":394},[359,362,365,368,371,374,377],[12,360,361],{},"Starting up Visual Studio 2017 RC today, opening a Xamarin Forms application and building",[12,363,364],{},"I am presented with…\n“Unable to start Build 4.3.0.664 agent. when building iOS apps”",[12,366,367],{},"Uggh, yes another build issue.  So before I can do anything I must once again work through connectivity, emulator, build errors.  Note, if you venture to go in this direction with your learning\u002Fcareer patience is a must.",[12,369,370],{},"1.) Delete this folder:\nC:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\Extensions\\Xamarin",[12,372,373],{},"2.) Delete this folder:\nC:\\Users{username}\\AppData\\Local\\Microsoft\\VisualStudio\\15.0_3bcaeaa8\n(this hash needs to correspond to the instance of VS 2017 you are using)   I am using 2017 RC.4+26206.0 right now by the way.",[12,375,376],{},"References:",[12,378,379,382,385,386],{},[18,380],{"title":381,"href":381},"https:\u002F\u002Fbugzilla.xamarin.com\u002Fshow_bug.cgi?id=52320",[18,383,381],{"href":381,"rel":384},[291]," ",[18,387,389],{"style":262,"href":388},"\u002Farticles\u002Fimages\u002Fopen-live-writer-f3509fbbd236_cabe-xambear_2.png",[22,390],{"title":391,"style":267,"border":26,"alt":391,"src":392,"width":393,"height":342},"xambear","\u002Farticles\u002Fimages\u002Fopen-live-writer-f3509fbbd236_cabe-xambear_thumb.png",238,{"title":36,"searchDepth":51,"depth":51,"links":395},[],"2017-02-11T07:30:20.2700000-05:00",{},"\u002Farticles\u002Funable-to-start-build-4-3-0-664-agent-when-building-ios-apps",{"title":356,"description":347},"articles\u002Funable-to-start-build-4-3-0-664-agent-when-building-ios-apps",[236],"Bvk7DkjOIcwpBI7iCzu8qpkqzDHOQEEgIXovxsIBVhQ",1781574770367]