Resharper changes cause compiler errors in VS2012

I just downloaded Resharper and am using it for the 30-day trial period.  I am using it with Visual Studio 2012.  I have seen that some changes Resharper wants to make in my code cause compiler errors.  For example, I had the following lines of code:

Location newLocation;
Move(new Location(State_XLocation, State_YLocation),
new Location(State_DropX, State_DropY),
deadband, m_tickSpan, Speed, out newLocation);

Resharper suggesting in-lining the out parameter:

Move(new Location(State_XLocation, State_YLocation),
new Location(State_DropX, State_DropY),
deadband, m_tickSpan, Speed, out Location newLocation);

However, VS2012 does not know about in-lined out parameters, and this became a compiler error.  How can I tell Resharper only to make changes that are valid for VS2012?

Thank you.

0
3 comments
Official comment

Hello Rob!

 

Thank you for contacting us.

Please try to specify the target C# version explicitly by selecting the project in the Solution Explorer and using theC# Language Level property in the Properties window (choose View | Properties Window in the menu).

Thank you.

Avatar
Permanently deleted user

Thank you.  For the record, since I'm targeting .Net version 4.5, I need to select C# 5.0.

RobR

0
Avatar
Permanently deleted user

It seems to me that since I'm already selecting the .Net version in my project settings, Resharper should be able to automatically determine the target C# version number.

RobR

0

Please sign in to leave a comment.