Any reference to profilecommon causes error Value cannot be null. Parameter name: type

前端 未结 3 1153
滥情空心
滥情空心 2021-01-13 04:56

I have searched for two weeks, every night, exhaustively reading forum threads and trying all suggested solutions no matter how outlandish. Just as is the case with the man

3条回答
  •  心在旅途
    2021-01-13 05:33

    Are you saying you can't access the profile in code? If so could you post some code/pseudocode pls? I think this is an issue I encountered last week (and fixed) ... – 5arx 11 mins ago

    Had a similar problem last week - converting an ASP.Net website project to a web application one. In the former, the profile is defined declaratively in web.config. However web application projects have trouble accessing the dynamically generated app_code DLL (as its not built by .Net until runtime). The workaround is to access the profile's properties thus:

    ComplexProfileProperty _cpp = (ComplexProfileProperty)HttpContext.Current.Profile.GetPropertyValue("valuename"); 
    

    Hth,

    apologies if I've totally misread your question - hard to be certain without code examples :-)

提交回复
热议问题