Next question for ReSharper 4

Another question about R# 4:
Will be able to have installed R# 4 on Visual Studio 2008 but work on
projects with Target Framework set to 2.0 ?

--
Peter Sulek
terrorix@centrum.sk
XanaNews ver. 1.18.1.6

12 comments
Comment actions Permalink

Hello Peter,

Yes. Since VS2008 always uses C# 3.0 compiler, you will be able to use C#
3.0 language features when targeting .NET Framework 2.0. For extension methods,
you'll need some tricking though, since you don't have System.Core with ExtensionMethodAttribute.


Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Another question about R# 4:
PS> Will be able to have installed R# 4 on Visual Studio 2008 but work
PS> on
PS> projects with Target Framework set to 2.0 ?


0
Comment actions Permalink

Ilya Ryzhenkov wrote:

Hello Peter,

Yes. Since VS2008 always uses C# 3.0 compiler, you will be able to
use C# 3.0 language features when targeting .NET Framework 2.0. For
extension methods, you'll need some tricking though, since you don't
have System.Core with ExtensionMethodAttribute.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Another question about R# 4:
PS> Will be able to have installed R# 4 on Visual Studio 2008 but work
PS> on
PS> projects with Target Framework set to 2.0 ?


Thanks, i means using only c# 2.0 language with .NET Framework 2.0
targeting. From your answer this is also OK, right?

--
Peter Sulek
terrorix@centrum.sk
XanaNews ver. 1.18.1.6

0
Comment actions Permalink

Hello Peter,

You can't use C# 2.0 compiler in VS2008 without manually hacking msbuild
files. You can force yourself not using lambdas and LINQ and extension methods,
thought. Targeting .NET Framework 2.0 does NOT mean using C# 2.0 compiler.
As CLR didn't change since .NET 2.0 (except fixes), you will be able to run
assemblies built with C# 3.0 compiler in .NET 2.0 environment. Framework
targeting switches which assemblies will be used by compiler.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Ilya Ryzhenkov wrote:
PS>
>> Hello Peter,
>>
>> Yes. Since VS2008 always uses C# 3.0 compiler, you will be able to
>> use C# 3.0 language features when targeting .NET Framework 2.0. For
>> extension methods, you'll need some tricking though, since you don't
>> have System.Core with ExtensionMethodAttribute.
>>
>> Sincerely,
>> Ilya Ryzhenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>> PS> Another question about R# 4:
>> PS> Will be able to have installed R# 4 on Visual Studio 2008 but
>> work
>> PS> on
>> PS> projects with Target Framework set to 2.0 ?
PS> Thanks, i means using only c# 2.0 language with .NET Framework 2.0
PS> targeting. From your answer this is also OK, right?
PS>


0
Comment actions Permalink

Ilya Ryzhenkov wrote:

Hello Peter,

You can't use C# 2.0 compiler in VS2008 without manually hacking
msbuild files. You can force yourself not using lambdas and LINQ and
extension methods, thought. Targeting .NET Framework 2.0 does NOT
mean using C# 2.0 compiler. As CLR didn't change since .NET 2.0
(except fixes), you will be able to run assemblies built with C# 3.0
compiler in .NET 2.0 environment. Framework targeting switches which
assemblies will be used by compiler.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Ilya Ryzhenkov wrote:
PS>

Hello Peter,

Yes. Since VS2008 always uses C# 3.0 compiler, you will be able to
use C# 3.0 language features when targeting .NET Framework 2.0.
For extension methods, you'll need some tricking though, since
you don't have System.Core with ExtensionMethodAttribute.

Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>>PS> Another question about R# 4:
>>PS> Will be able to have installed R# 4 on Visual Studio 2008 but

work

>>PS> on
>>PS> projects with Target Framework set to 2.0 ?
PS> Thanks, i means using only c# 2.0 language with .NET Framework 2.0
PS> targeting. From your answer this is also OK, right?
PS>


Sorry for missunderstanding, i mean that we use only c# 2.0 lang
syntax, not using 3.x lang features. We dont use c# 2.0 compiler.

Sorry for my bad english :-|

--
Peter Sulek
terrorix@centrum.sk
XanaNews ver. 1.18.1.6

0
Comment actions Permalink

Hello Peter,

You ARE using lang C# 3.0 features, because not only lambdas, LINQ, extension
methods and other new features were added. Type inference changed and some
resolve in hierarchies changed. So you may very well end up with code that
would NOT compile with C# 2.0 compiler, if this is the goal. It's not enough
to avoid new features of language to maintain compatiblity.

Anyway, we plan to include Language Level feature in ReSharper 4, which you
can set to 2.0 or 3.0 version of C# language. This would be per-project setting,
and ReSharper will behave according to language level throughout the feature
set, like suggest or not suggest generating automatic properties, etc.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Ilya Ryzhenkov wrote:
PS>
>> Hello Peter,
>>
>> You can't use C# 2.0 compiler in VS2008 without manually hacking
>> msbuild files. You can force yourself not using lambdas and LINQ and
>> extension methods, thought. Targeting .NET Framework 2.0 does NOT
>> mean using C# 2.0 compiler. As CLR didn't change since .NET 2.0
>> (except fixes), you will be able to run assemblies built with C# 3.0
>> compiler in .NET 2.0 environment. Framework targeting switches which
>> assemblies will be used by compiler.
>>
>> Sincerely,
>> Ilya Ryzhenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>> PS> Ilya Ryzhenkov wrote:
>> PS>
>>>> Hello Peter,
>>>>
>>>> Yes. Since VS2008 always uses C# 3.0 compiler, you will be able to
>>>> use C# 3.0 language features when targeting .NET Framework 2.0.
>>>> For extension methods, you'll need some tricking though, since
>>>> you don't have System.Core with ExtensionMethodAttribute.
>>>> Sincerely,
>>>> Ilya Ryzhenkov
>>>> JetBrains, Inc
>>>> http://www.jetbrains.com
>>>> "Develop with pleasure!"
>>>> PS> Another question about R# 4:
>>>> PS> Will be able to have installed R# 4 on Visual Studio 2008 but
>>>> work
>>>> PS> on
>>>> PS> projects with Target Framework set to 2.0 ?
>> PS> Thanks, i means using only c# 2.0 language with .NET Framework
>> 2.0
>> PS> targeting. From your answer this is also OK, right?
>> PS>
PS> Sorry for missunderstanding, i mean that we use only c# 2.0 lang
PS> syntax, not using 3.x lang features. We dont use c# 2.0 compiler.
PS>
PS> Sorry for my bad english :-|
PS>


0
Comment actions Permalink

Ilya Ryzhenkov wrote:

Hello Peter,

You ARE using lang C# 3.0 features, because not only lambdas, LINQ,
extension methods and other new features were added. Type inference
changed and some resolve in hierarchies changed. So you may very well
end up with code that would NOT compile with C# 2.0 compiler, if this
is the goal. It's not enough to avoid new features of language to
maintain compatiblity. Anyway, we plan to include Language Level
feature in ReSharper 4, which you can set to 2.0 or 3.0 version of C#
language. This would be per-project setting, and ReSharper will
behave according to language level throughout the feature set, like
suggest or not suggest generating automatic properties, etc.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


PS> Ilya Ryzhenkov wrote:
PS>

Hello Peter,

You can't use C# 2.0 compiler in VS2008 without manually hacking
msbuild files. You can force yourself not using lambdas and LINQ
and extension methods, thought. Targeting .NET Framework 2.0 does
NOT mean using C# 2.0 compiler. As CLR didn't change since .NET
2.0 (except fixes), you will be able to run assemblies built with
C# 3.0 compiler in .NET 2.0 environment. Framework targeting
switches which assemblies will be used by compiler.

Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>>PS> Ilya Ryzhenkov wrote:

PS>

Hello Peter,

Yes. Since VS2008 always uses C# 3.0 compiler, you will be
able to use C# 3.0 language features when targeting .NET
Framework 2.0. For extension methods, you'll need some
tricking though, since you don't have System.Core with
ExtensionMethodAttribute. Sincerely,
Ilya Ryzhenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>>>>PS> Another question about R# 4:
>>>>PS> Will be able to have installed R# 4 on Visual Studio 2008 but

work

>>>>PS> on
>>>>PS> projects with Target Framework set to 2.0 ?
>>PS> Thanks, i means using only c# 2.0 language with .NET Framework

2.0

>>PS> targeting. From your answer this is also OK, right?

PS>

PS> Sorry for missunderstanding, i mean that we use only c# 2.0 lang
PS> syntax, not using 3.x lang features. We dont use c# 2.0 compiler.
PS> PS> Sorry for my bad english :-|
PS>


Yes i mean such a feature of r#.

--
Peter Sulek
terrorix@centrum.sk
XanaNews ver. 1.18.1.6

0
Comment actions Permalink

Anyway, we plan to include Language Level feature in
ReSharper 4, which you
can set to 2.0 or 3.0 version of C# language. This
would be per-project setting,
and ReSharper will behave according to language level
throughout the feature
set, like suggest or not suggest generating automatic
properties, etc.


I assume that R# will take care of this automatically based on the project's target framework properties, no? (based on you saying "you can set" I wasn't sure.)

0
Comment actions Permalink

Hello Jeremy,

Target Framework and Target Language are two different things. You can compile
with C# 3.0 for .NET 2.0. Why should we infer C# 2.0 from the fact someone
targets .NET 2.0?

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


>> Anyway, we plan to include Language Level feature in
>> ReSharper 4, which you
>> can set to 2.0 or 3.0 version of C# language. This
>> would be per-project setting,
>> and ReSharper will behave according to language level
>> throughout the feature
>> set, like suggest or not suggest generating automatic
>> properties, etc.
IR> I assume that R# will take care of this automatically based on the
IR> project's target framework properties, no? (based on you saying "you
IR> can set" I wasn't sure.)
IR>


0
Comment actions Permalink

Apologies, I neglected to mention both. Obviously, R# should infer the correct settings from whatever can be extracted from the project properties. As far as I'm aware, however, mixing different target framework and language requires doing things like using statement hacks, so R# should be able to treat them as one thing (target framework) just as I originally mentioned, no?

0
Comment actions Permalink

Hello Jeremy,

Things like the "var" keyword and using lambdas instead of delegate(){} are
just compiler tricks and can be used in vs2008 when targetting the 2.0 framework.
In fact, it's one of the great advantages of vs2008. What you are suggesting
would effectively turn vs2008 into vs2005, which is not a desirable thing
at all.

- Oisin

Apologies, I neglected to mention both. Obviously, R# should infer the
correct settings from whatever can be extracted from the project
properties. As far as I'm aware, however, mixing different target
framework and language requires doing things like using statement
hacks, so R# should be able to treat them as one thing (target
framework) just as I originally mentioned, no?



0
Comment actions Permalink

I am in a situation where I'm using VS2008, but some other people working on a particular project are using VS2005. It's not a case of me wanting to turn 2008 into 2005, but I don't want the code filled-up with things which turn out not to compile for the VS2005 people.

So I am 'using 2008 but not using C#3.0 features'. There are people with a legitimate, albeit transient (I hope!), need to run in this situation.

Will

0
Comment actions Permalink

Hello,

I am in a situation where I'm using VS2008, but some other people
working on a particular project are using VS2005.


It's theoretically possible to make VS2005 build with C# 3.0. Of course Visual
Studio features will treat the new constructs as errors, but with R# that's
hardly noticeable. Would be interesting if someone tried the thing.


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


0

Please sign in to leave a comment.