Ensure that HttpConfiguration.EnsureInitialized()

前端 未结 14 1106
一生所求
一生所求 2020-11-30 23:31

I\'ve installed Visual Studio 2013 and when I run my app I get the error below.

I\'ve got no idea as to where I\'m to initialized this object.

What to do?

14条回答
  •  孤街浪徒
    2020-11-30 23:47

    I actually got this error when I was using Attribute Routing within my WebApi.

    I had

    [Route("webapi/siteTypes/{siteTypeId"]

    instead of

    [Route("webapi/siteTypes/{siteTypeId}"]

    for my route and got this error. I had simply missed out the closing curly bracket. Once I added it back in, this error didn't occur again.

提交回复
热议问题