[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Why does a service pack that targets VS2008 and .NET 3.5 is cause a compilation error in a VS2005 build that targets .NET 3.0?

<.>

11/5/2008 7:06:00 PM

Hi,

After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following
warning in a VS2005 build:

error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect' is
obsolete: 'Avoid using BitmapEffects as they have very poor performance
characteristics. They will be deprecated in a future version. Consider
using the UIElement.Effect property and ShaderEffects where appropriate
instead.'

We do not get this error with VS2008 and .NET installed without SP1.

Why does a service pack that targets VS2008 and .NET 3.5 is cause a
compilation warning in a VS2005 build that targets .NET 3.0?


4 Answers

Jeroen Mostert

11/5/2008 7:50:00 PM

0

.. wrote:
> After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following
> warning in a VS2005 build:
>
> error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect' is
> obsolete: 'Avoid using BitmapEffects as they have very poor performance
> characteristics. They will be deprecated in a future version. Consider
> using the UIElement.Effect property and ShaderEffects where appropriate
> instead.'
>
> We do not get this error with VS2008 and .NET installed without SP1.
>
> Why does a service pack that targets VS2008 and .NET 3.5 is cause a
> compilation warning in a VS2005 build that targets .NET 3.0?
>
Because the .NET 2.0, 3.0 and 3.5 framework all share the 2.0 runtime and
the 2.0 framework library. The VS2008 service pack only targets VS, but .NET
3.5 SP1 (which has to be installed with it) upgrades the common 2.0 runtime
to 2.0 SP2. The ObsoleteAttribute is part of the class' metadata and will
affect compilers regardless of their version or target settings.

This shared base is how VS2008 can easily target different versions in the
first place (and also why you can actually write .NET 3.0 and 3.5
applications using VS2005, as long as you only use the new classes and not
the new language features).

As to the actual problem, you have two obvious solutions: either take the
deprecation warning to heart and rewrite your code (obviously the best
solution, but it may not be feasible) or exclude the warning for now. You
can selectively disable warnings at specific locations in your code by using
"#pragma warning" (excluding all obsolescence warnings globally is another
option, but is obviously risky if other classes are obsoleted after you do
this).

--
J.

<.>

11/5/2008 8:54:00 PM

0

Thanks Jeroen - It seems that in this case the PresentationCore assembly was
modified.

"Jeroen Mostert" <jmostert@xs4all.nl> wrote in message
news:4911f8ea$0$188$e4fe514c@news.xs4all.nl...
>. wrote:
>> After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following
>> warning in a VS2005 build:
>>
>> error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect'
>> is obsolete: 'Avoid using BitmapEffects as they have very poor
>> performance characteristics. They will be deprecated in a future
>> version. Consider using the UIElement.Effect property and ShaderEffects
>> where appropriate instead.'
>>
>> We do not get this error with VS2008 and .NET installed without SP1.
>>
>> Why does a service pack that targets VS2008 and .NET 3.5 is cause a
>> compilation warning in a VS2005 build that targets .NET 3.0?
> Because the .NET 2.0, 3.0 and 3.5 framework all share the 2.0 runtime and
> the 2.0 framework library. The VS2008 service pack only targets VS, but
> .NET 3.5 SP1 (which has to be installed with it) upgrades the common 2.0
> runtime to 2.0 SP2. The ObsoleteAttribute is part of the class' metadata
> and will affect compilers regardless of their version or target settings.
>
> This shared base is how VS2008 can easily target different versions in the
> first place (and also why you can actually write .NET 3.0 and 3.5
> applications using VS2005, as long as you only use the new classes and not
> the new language features).
>
> As to the actual problem, you have two obvious solutions: either take the
> deprecation warning to heart and rewrite your code (obviously the best
> solution, but it may not be feasible) or exclude the warning for now. You
> can selectively disable warnings at specific locations in your code by
> using "#pragma warning" (excluding all obsolescence warnings globally is
> another option, but is obviously risky if other classes are obsoleted
> after you do this).
>
> --
> J.


Cowboy

11/6/2008 2:34:00 AM

0

More is heading ot the core. You can potentially see more of this. it is
also the reason .NET 4.0 will be a new framework rather than a bolt on (like
3.x).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/Greg...

or just read it:
http://feeds.feedburner.com/Gre...

********************************************
| Think outside the box! |
********************************************
<.> wrote in message news:ecs9Pm3PJHA.588@TK2MSFTNGP06.phx.gbl...
> Hi,
>
> After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following
> warning in a VS2005 build:
>
> error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect' is
> obsolete: 'Avoid using BitmapEffects as they have very poor performance
> characteristics. They will be deprecated in a future version. Consider
> using the UIElement.Effect property and ShaderEffects where appropriate
> instead.'
>
> We do not get this error with VS2008 and .NET installed without SP1.
>
> Why does a service pack that targets VS2008 and .NET 3.5 is cause a
> compilation warning in a VS2005 build that targets .NET 3.0?
>

<.>

11/6/2008 5:03:00 PM

0

Thanks for the heads up Cowboy. I'll pass it along to the watchers.

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:OFNlKg7PJHA.2720@TK2MSFTNGP03.phx.gbl...
> More is heading ot the core. You can potentially see more of this. it is
> also the reason .NET 4.0 will be a new framework rather than a bolt on
> (like 3.x).
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> Subscribe to my blog
> http://feeds.feedburner.com/Greg...
>
> or just read it:
> http://feeds.feedburner.com/Gre...
>
> ********************************************
> | Think outside the box! |
> ********************************************
> <.> wrote in message news:ecs9Pm3PJHA.588@TK2MSFTNGP06.phx.gbl...
>> Hi,
>>
>> After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following
>> warning in a VS2005 build:
>>
>> error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect'
>> is obsolete: 'Avoid using BitmapEffects as they have very poor
>> performance characteristics. They will be deprecated in a future
>> version. Consider using the UIElement.Effect property and ShaderEffects
>> where appropriate instead.'
>>
>> We do not get this error with VS2008 and .NET installed without SP1.
>>
>> Why does a service pack that targets VS2008 and .NET 3.5 is cause a
>> compilation warning in a VS2005 build that targets .NET 3.0?
>>
>