VS 2008 and Targeted Frameworks Other Than 3.5

I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed that R# 4
beta 1 does not seem to check the targeted framework setting of the project.
So I get C# 3.0 messages for my C# 2.0 projects. Things like Implicit
Variable messages, and Collection Initializers.

R# 4 should really check the targeted framework and only give the
appropriate messages for the framework.

Don Demsak
www.donxml.com

6 comments
Comment actions Permalink

Hello,

I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed
that R# 4 beta 1 does not seem to check the targeted framework setting
of the project. So I get C# 3.0 messages for my C# 2.0 projects.


You cannot create or open a C# 2.0 project in VS2008.

At least, without hacking into the project file.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Yes you can, it is called multi targeted support and it is something that is
highly promoted by Microsoft.

Just do, File|New|Project

In the Project Window, in the upper right hand corner, there is a listbox
that contains 3 options, .NET Framework 2.0, .NET Framework 3.0, and .NET
Framework 3.5. This is how you can pick which framework you want to target.
After creating a project, you can change the targeted framework via the
Project Property Page. Just right click a project and select Properties.
In the Application Tab, there is a Target Framework listbox with the same 3
options .NET Framework 2.0, .NET Framework 3.0, and .NET Framework 3.5.

VS 2008 is the first version of VS that supports targeting multiple
frameworks. See ScottGu's blog entry on it:
http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx

Here's a snippet from it:
You might be wondering: "so what value do I get when using VS 2008 to work
on a ASP.NET 2.0 project versus just using my VS 2005 today?" Well, the
good news is that you get a ton of tool-specific value with VS 2008 that
you'll be able to take advantage of immediately with your existing projects
without having to upgrade your framework/ASP.NET version. A few big tool
features in the web development space I think you'll really like include:

JavaScript intellisense
Much richer JavaScript debugging
Nested ASP.NET master page support at design-time
Rich CSS editing and layout support within the WYSIWYG designer
Split-view designer support for having both source and design views open on
a page at the same time
A much faster ASP.NET page designer - with dramatic perf improvements in
view-switches between source/design mode
Automated .SQL script generation and hosting deployment support for
databases on remote servers
You'll be able to use all of the above features with any version of the .NET
Framework - without having to upgrade your project to necessarily target
newer framework versions.

-



So, yes, you can target .Net 2.0 and .Net 3.0 in VS 2008. Which means
things like Implicit Variables, and Collection Initializers are not an
option when targeting .Net 2.0 or .Net 3.0. R# needs to filter its
abilities/messages based on which framework is targeted. Otherwise, when
I'm developing code based on the .Net 2.0 or .Net 3.0 frameworks, I get R#
messages that are not applicable for those frameworks.


Don Demsak
www.donxml.com

"Serge Baltic" <baltic@intellij.net> wrote in message
news:dc0986bfdbc5f8ca930d7a82abf5@news.intellij.net...

Hello,

>
>> I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed
>> that R# 4 beta 1 does not seem to check the targeted framework setting
>> of the project. So I get C# 3.0 messages for my C# 2.0 projects.
>

You cannot create or open a C# 2.0 project in VS2008.

>

At least, without hacking into the project file.

>


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”

>

0
Comment actions Permalink

Hello,

when you look at the properties window of the project, you can select the
language level. If you set it to C# 2.0, it will behave as you want it to.

Kind regards,
Henning Krause

"Don Demsak" <donxml@gmail.com> wrote in message
news:g21cse$spe$1@is.intellij.net...

Yes you can, it is called multi targeted support and it is something that
is highly promoted by Microsoft.

>

Just do, File|New|Project

>

In the Project Window, in the upper right hand corner, there is a listbox
that contains 3 options, .NET Framework 2.0, .NET Framework 3.0, and .NET
Framework 3.5. This is how you can pick which framework you want to
target.
After creating a project, you can change the targeted framework via the
Project Property Page. Just right click a project and select Properties.
In the Application Tab, there is a Target Framework listbox with the same
3 options .NET Framework 2.0, .NET Framework 3.0, and .NET Framework 3.5.

>

VS 2008 is the first version of VS that supports targeting multiple
frameworks. See ScottGu's blog entry on it:
http://weblogs.asp.net/scottgu/archive/2007/06/20/vs-2008-multi-targeting-support.aspx

>

Here's a snippet from it:
You might be wondering: "so what value do I get when using VS 2008 to work
on a ASP.NET 2.0 project versus just using my VS 2005 today?" Well, the
good news is that you get a ton of tool-specific value with VS 2008 that
you'll be able to take advantage of immediately with your existing
projects without having to upgrade your framework/ASP.NET version. A few
big tool features in the web development space I think you'll really like
include:

>

JavaScript intellisense
Much richer JavaScript debugging
Nested ASP.NET master page support at design-time
Rich CSS editing and layout support within the WYSIWYG designer
Split-view designer support for having both source and design views open
on a page at the same time
A much faster ASP.NET page designer - with dramatic perf improvements in
view-switches between source/design mode
Automated .SQL script generation and hosting deployment support for
databases on remote servers
You'll be able to use all of the above features with any version of the
.NET Framework - without having to upgrade your project to necessarily
target newer framework versions.

>

-------------------

>

So, yes, you can target .Net 2.0 and .Net 3.0 in VS 2008. Which means
things like Implicit Variables, and Collection Initializers are not an
option when targeting .Net 2.0 or .Net 3.0. R# needs to filter its
abilities/messages based on which framework is targeted. Otherwise, when
I'm developing code based on the .Net 2.0 or .Net 3.0 frameworks, I get R#
messages that are not applicable for those frameworks.

>
>

Don Demsak
www.donxml.com

>

"Serge Baltic" <baltic@intellij.net> wrote in message
news:dc0986bfdbc5f8ca930d7a82abf5@news.intellij.net...

>> Hello,
>>
>>> I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed
>>> that R# 4 beta 1 does not seem to check the targeted framework setting
>>> of the project. So I get C# 3.0 messages for my C# 2.0 projects.
>>
>> You cannot create or open a C# 2.0 project in VS2008.
>>
>> At least, without hacking into the project file.
>>
>> —
>> Serge Baltic
>> JetBrains, Inc — http://www.jetbrains.com
>> “Develop with pleasure!”
>>
>>

0
Comment actions Permalink

Hello,

Yes you can, it is called multi targeted support and it is something
that is highly promoted by Microsoft.

Just do, File|New|Project

In the Project Window, in the upper right hand corner, there is a
listbox that contains 3 options, .NET Framework 2.0, .NET Framework
3.0, and .NET Framework 3.5. This is how you can pick which framework
you want to target. After creating a project, you can change the
targeted framework via the Project Property Page. Just right click a
project and select Properties. In the Application Tab, there is a
Target Framework listbox with the same 3 options .NET Framework 2.0,
.NET Framework 3.0, and .NET Framework 3.5.


What does this have to do to C# version? Nothing at all. It's C# 3.0 all
the way round.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

Don-

As Henning said, you can specify via the project property grid.

We use this setting in projects where people are still using older versions
of R#. However, we use the C# 3.0 settings and language features on some
.NET 2.0 projects since the 3.0 compiler spits out 2.0 bits. Great to use
var, type initializers, et al on .NET 2.0 projects!

Jeff

"Don Demsak" <donxml@gmail.com> wrote in message
news:g210hq$llp$1@is.intellij.net...

I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed that R#
4 beta 1 does not seem to check the targeted framework setting of the
project. So I get C# 3.0 messages for my C# 2.0 projects. Things like
Implicit Variable messages, and Collection Initializers.

>

R

  1. 4 should really check the targeted framework and only give the

appropriate messages for the framework.

>

Don Demsak
www.donxml.com



0
Comment actions Permalink

Yes, but it does feel weird. One would "think" that the default language
for the .Net 2.0 Framework would be C# 2.0. But, I guess that isn't
JetBrains call. Man, it just feels wrong.

Don Demsak
www.donxml.com

"Jeff Key" <jeff.key@sliver.com> wrote in message
news:g21pv9$5n0$1@is.intellij.net...

Don-

>

As Henning said, you can specify via the project property grid.

>

We use this setting in projects where people are still using older
versions of R#. However, we use the C# 3.0 settings and language features
on some .NET 2.0 projects since the 3.0 compiler spits out 2.0 bits. Great
to use var, type initializers, et al on .NET 2.0 projects!

>

Jeff

>

"Don Demsak" <donxml@gmail.com> wrote in message
news:g210hq$llp$1@is.intellij.net...

>> I use VS 2008 for my .Net 2.0 and .Net 3.0 development and noticed that
>> R# 4 beta 1 does not seem to check the targeted framework setting of the
>> project. So I get C# 3.0 messages for my C# 2.0 projects. Things like
>> Implicit Variable messages, and Collection Initializers.
>>
>> R# 4 should really check the targeted framework and only give the
>> appropriate messages for the framework.
>>
>> Don Demsak
>> www.donxml.com

0

Please sign in to leave a comment.