Convert obsolete properties after upgrading to v16.1 ASP.NET

24 June 2016

Update (July 2016): We've created a small tool to help you update your projects for these breaking changes - Download it here

In the v16.1 release, we decided to mark older properties of several of ASP.NET controls as obsolete. And for properties older than couple of years, they're marked explicity as IsError:

... the compiler will treat usage of the obsolete program element as an error. -MSDN

Why?

Over time, some properties of our ASP.NET controls get moved, replaced, or removed. This happens when we introduce a new feature or refactor old code. Usually, we'll add a recommendation in the release notes for you to start using the new property. But let's face it, we don't all read release notes. Sometimes, we just miss the minor details.

All these properties (class members) were set to obsolete long time ago. For example, the DevExpress.Web.ASPxWebControl.RegisterUtilsScript(Page page) method became obsolete in the v10.1 release. So all of these properties produce warnings in user projects since they were deprecated.

Starting with the v16.1 release, they produce errors instead of warnings. Therefore, you should not use them and use the newer properties. Here's the full list of obsolete marked properties: Knowledgebase T395721

No compiler warning

Typically, this is not a problem. However, if you have the following:

  1. Web Application Project
  2. Reference to an obsolete property in markup

Then you may get a runtime error instead of a compile time error.

For example, if I have an older project that uses the ASPxListBox's LoadingPanelText property, then I can compile it without any errors using the latest v16.1 release:

Error

Run the project in the browser and you get the dreaded yellow screen of death:

YSD

Good news, there is a simple way to have Visual Studio detect these obsolete properties and show errors, making it easy for you to update your markup.

Easy Workaround

Since Visual Studio does not compile ASPx page markup in Wep Application-type projects, the error appears only at runtime when page markup is being compiled. This is very inconvenient for upgrading existing web applications. Therefore, we suggest you try a workaround that will force Visual Studio to compile the ASPx markup and display the errors immediately.

Add the following command in the "Post-Build action" box of your project settings:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_compiler.exe -v / -p "$(SolutionDir)$(ProjectName)"

Workaround

Now, you'll be notified of the obselete property and the suggested new property too:

CompilerErrorShown

You can find a sample solution, workaround video, and see the full list of obsolete properties here: Knowledgebase T395721

If you have any issues upgrading, please contact our support team and they will help you: DevExpress Support Center

Thanks!


Your Next Great .NET App Starts Here

Year after year, .NET developers such as yourself consistently vote DevExpress products #1.

Experience the DevExpress difference for yourself and download a free 30-day trial of all our products today: DevExpress.com/trial (free support is included during your evaluation).

3 comment(s)
Neal

It bit me in my custom theme skin.  Sure would be nice if your project converter handled this.

24 June, 2016
Mehul Harry (DevExpress)

Hi Neal,

It's tricky because some of those properties are not just renamed, they may have moved to different sub-properties like under Settings.something.

That said, I will explore it with the team, thanks.

24 June, 2016
Khalid Alhazmi

Great tip.

Thank you

27 June, 2016

Please login or register to post comments.