René's URL Explorer Experiment


Title: Incompatibility with Web API Help Pages (InvalidOperationException: Stack Empty) · Issue #4 · webadvanced/Structuremap.WebAPI2 · GitHub

Open Graph Title: Incompatibility with Web API Help Pages (InvalidOperationException: Stack Empty) · Issue #4 · webadvanced/Structuremap.WebAPI2

X Title: Incompatibility with Web API Help Pages (InvalidOperationException: Stack Empty) · Issue #4 · webadvanced/Structuremap.WebAPI2

Description: I have a Web API project which uses StructureMap for its DI. It's been working fine for awhile, but I'm having some issues with the Web API help pages (Microsoft.AspNet.WebApi.HelpPage) where InvalidOperationExceptions are being thrown a...

Open Graph Description: I have a Web API project which uses StructureMap for its DI. It's been working fine for awhile, but I'm having some issues with the Web API help pages (Microsoft.AspNet.WebApi.HelpPage) where Inval...

X Description: I have a Web API project which uses StructureMap for its DI. It's been working fine for awhile, but I'm having some issues with the Web API help pages (Microsoft.AspNet.WebApi.HelpPage) whe...

Opengraph URL: https://github.com/webadvanced/Structuremap.WebAPI2/issues/4

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incompatibility with Web API Help Pages (InvalidOperationException: Stack Empty)","articleBody":"I have a Web API project which uses StructureMap for its DI. It's been working fine for awhile, but I'm having some issues with the Web API help pages (Microsoft.AspNet.WebApi.HelpPage) where InvalidOperationExceptions are being thrown as a result of an empty stack. \n\nTo test this, I created a new Web API project with the MVC help pages, and it works fine until I add the StructureMap.WebApi2 package, causing the previously mentioned exception to be thrown here, inside ModelDescriptionLink.cshtml when I try to view the documentation for routes involving models which are collections:\n\n```\nelse if (modelDescription is CollectionModelDescription)\n{\n    var collectionDescription = modelDescription as CollectionModelDescription;\n    var elementDescription = collectionDescription.ElementDescription;\n    @:Collection of @Html.DisplayFor(m =\u003e elementDescription.ModelType, \"ModelDescriptionLink\", new { modelDescription = elementDescription })\n}\nelse\n{\n    @Html.DisplayFor(m =\u003e modelDescription)\n}\n```\n\nIt's being thrown at `@:Collection of @Html.DisplayFor(m =\u003e elementDescription.ModelType, \"ModelDescriptionLink\", new { modelDescription = elementDescription })` when it tries to display the link to the resource description for his this model.\n\nThis is a slimmed down route that still causes the exception:\n\n```\n[Route(\"Test\")]\npublic IHttpActionResult Post([FromBody] IEnumerable\u003cMySimpleModel\u003e models)\n{\n    return null;\n}\n```\n\nAttempting to visit the documentation for this route at `http://localhost:21966/Help/Api/POST-Test` causes the exception:\n\n![Exception image](http://i.stack.imgur.com/irFU3.png)\n\nI was only able to find one [example of someone having the same problem](https://twitter.com/modul8com/status/492303789899407361) and their solutions were to switch from StructureMap to Ninject or to avoid the exception with null checks. \n\nHere's the top of the stack trace:\n\n```\n[InvalidOperationException: Stack empty.]\nSystem.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52\nSystem.Collections.Generic.Stack`1.Peek() +6693321\nSystem.Web.WebPages.WebPageBase.get_Output() +51\nSystem.Web.WebPages.WebPageBase.GetOutputWriter() +35\nSystem.Web.WebPages.WebPageExecutingBase.BeginContext(String virtualPath, Int32 startPosition, Int32 length, Boolean isLiteral) +50\nASP._Page_Areas_HelpPage_Views_Help_DisplayTemplates_ModelDescriptionLink_cshtml.Execute() in c:...ModelDescriptionLink.cshtml:28\nSystem.Web.WebPages.WebPageBase.ExecutePageHierarchy() +271\nSystem.Web.Mvc.WebViewPage.ExecutePageHierarchy() +122\nSystem.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +145\nSystem.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +695\nSystem.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +382\nSystem.Web.Mvc.Html.ActionCacheViewItem.Execute(HtmlHelper html, ViewDataDictionary viewData) +278\n```\n\nBy catching the exception in this place, it pops up later on in `HelpPageApiModel.cshtml` on a nearly identical line: `@Html.DisplayFor(m =\u003e m.ResourceDescription.ModelType, \"ModelDescriptionLink\", new { modelDescription = Model.ResourceDescription })`. This is the top of that stack trace:\n\n```\n[InvalidOperationException: Stack empty.]\nSystem.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +52\nSystem.Collections.Generic.Stack`1.Pop() +6667365\nSystem.Web.WebPages.WebPageBase.PopContext() +66\nSystem.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +154\n```\n","author":{"url":"https://github.com/Zajora","@type":"Person","name":"Zajora"},"datePublished":"2015-07-09T14:45:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4/Structuremap.WebAPI2/issues/4"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:71ad7d0b-3e57-3493-3b93-001460bae042
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9014:B720C:909C3:B81FD:699028AD
html-safe-nonceff6447cc66df0b84e246630a5ec89e8962c52bb92c645854deb8b558b83f36a1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDE0OkI3MjBDOjkwOUMzOkI4MUZEOjY5OTAyOEFEIiwidmlzaXRvcl9pZCI6IjgyMDI3MzkzMDYzMDcwMDQ1ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacfad3ed876fbc61dc5a59c5d98bf04ba4296191be31c9a10e1f43cb43739e2820
hovercard-subject-tagissue:94068169
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/webadvanced/Structuremap.WebAPI2/4/issue_layout
twitter:imagehttps://opengraph.githubassets.com/27e09be1c637385f518c7f1c813578bc72e4d9dae92e1c0a5230b57b733fbc2c/webadvanced/Structuremap.WebAPI2/issues/4
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/27e09be1c637385f518c7f1c813578bc72e4d9dae92e1c0a5230b57b733fbc2c/webadvanced/Structuremap.WebAPI2/issues/4
og:image:altI have a Web API project which uses StructureMap for its DI. It's been working fine for awhile, but I'm having some issues with the Web API help pages (Microsoft.AspNet.WebApi.HelpPage) where Inval...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameZajora
hostnamegithub.com
expected-hostnamegithub.com
None42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b
turbo-cache-controlno-preview
go-importgithub.com/webadvanced/Structuremap.WebAPI2 git https://github.com/webadvanced/Structuremap.WebAPI2.git
octolytics-dimension-user_id556018
octolytics-dimension-user_loginwebadvanced
octolytics-dimension-repository_id19080138
octolytics-dimension-repository_nwowebadvanced/Structuremap.WebAPI2
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id19080138
octolytics-dimension-repository_network_root_nwowebadvanced/Structuremap.WebAPI2
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues/4#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwebadvanced%2FStructuremap.WebAPI2%2Fissues%2F4
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fwebadvanced%2FStructuremap.WebAPI2%2Fissues%2F4
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=webadvanced%2FStructuremap.WebAPI2
Reloadhttps://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues/4
Reloadhttps://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues/4
Reloadhttps://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues/4
webadvanced https://patch-diff.githubusercontent.com/webadvanced
Structuremap.WebAPI2https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fwebadvanced%2FStructuremap.WebAPI2
Fork 1 https://patch-diff.githubusercontent.com/login?return_to=%2Fwebadvanced%2FStructuremap.WebAPI2
Star 12 https://patch-diff.githubusercontent.com/login?return_to=%2Fwebadvanced%2FStructuremap.WebAPI2
Code https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2
Issues 4 https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues
Pull requests 0 https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/pulls
Actions https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/actions
Projects 0 https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/projects
Wiki https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/wiki
Security 0 https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/security
Insights https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/pulse
Code https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2
Issues https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues
Pull requests https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/pulls
Actions https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/actions
Projects https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/projects
Wiki https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/wiki
Security https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/security
Insights https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/webadvanced/Structuremap.WebAPI2/issues/4
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/webadvanced/Structuremap.WebAPI2/issues/4
Incompatibility with Web API Help Pages (InvalidOperationException: Stack Empty)https://patch-diff.githubusercontent.com/webadvanced/Structuremap.WebAPI2/issues/4#top
https://github.com/Zajora
https://github.com/Zajora
Zajorahttps://github.com/Zajora
on Jul 9, 2015https://github.com/webadvanced/Structuremap.WebAPI2/issues/4#issue-94068169
https://camo.githubusercontent.com/4c6b4a388cf565cc0a974207f8288a82b0d7009de9aeece9c23866bc0977f49b/687474703a2f2f692e737461636b2e696d6775722e636f6d2f69724655332e706e67
example of someone having the same problemhttps://twitter.com/modul8com/status/492303789899407361
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.