Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForMember angering ReSharper? - Non-existing PCL profile on client machine causing compile/R# errors #381

Closed
i8beef opened this issue Sep 3, 2013 · 52 comments
Labels
Bug
Milestone

Comments

@i8beef
Copy link

@i8beef i8beef commented Sep 3, 2013

I'm trying to use the ForMember to add an ignore mapping to an object. ReSharper refuses to believe that ".ForMember(x => x.Thing, o => o.Ignore())" exists, though it's fine with using the string varient of that method. I'd rather use the former for obvious reasons, but seem to be stuck using the latter for now.

Note it, will COMPILE the other way, ReSharper just doesn't seem able to grok the Expression using the other one. Using 3.0.0 NuGet package.

@jbogard
Copy link
Member

@jbogard jbogard commented Sep 3, 2013

So you're using the ForMember("Thing", o => o.Ignore()) version?

On Tue, Sep 3, 2013 at 3:58 PM, Michael Hallock notifications@github.comwrote:

I'm trying to use the ForMember to add an ignore mapping to an object.
ReSharper refuses to believe that ".ForMember(x => x.Thing, o =>
o.Ignore())" exists, though it's fine with using the string varient of that
method. I'd rather use the former for obvious reasons, but seem to be stuck
using the latter for now.

Note it, will COMPILE the other way, ReSharper just doesn't seem able to
grok the Expression using the other one. Using 3.0.0 NuGet package.


Reply to this email directly or view it on GitHubhttps://github.com//issues/381
.

@i8beef
Copy link
Author

@i8beef i8beef commented Sep 3, 2013

Opposite actually. That works fine (And is what I'm using as a workaround for now). ReSharper (Latest) refuses to recognize the LINQ expression version.

@jbogard
Copy link
Member

@jbogard jbogard commented Sep 4, 2013

Hmm, have you tried opening and closing VS? I've had R# do this to me a
couple of times (on other things).

On Tue, Sep 3, 2013 at 5:40 PM, Michael Hallock notifications@github.comwrote:

Opposite actually. That works fine (And is what I'm using as a workaround
for now). ReSharper (Latest) refuses to recognize the LINQ expression
version.


Reply to this email directly or view it on GitHubhttps://github.com//issues/381#issuecomment-23753041
.

@i8beef
Copy link
Author

@i8beef i8beef commented Sep 4, 2013

Yes. All of our machines here are having the issue. ReSharper seems to think destinationMember is of type System.Linq.Expressions.Expression`1, and doesn't consider a normal Lambda expression to match that.

@Fa-C-Shus
Copy link

@Fa-C-Shus Fa-C-Shus commented Sep 20, 2013

I agree with i8Beef's experience. On all our dev workstations it also objects to the dest being linq.
Who is really the responsible party? AutoMapper or ReSharper?

@jbogard
Copy link
Member

@jbogard jbogard commented Sep 22, 2013

Not sure, I'm not seeing this, VS2012 and R# 8.0.1

@i8beef
Copy link
Author

@i8beef i8beef commented Sep 23, 2013

We are on visual studio 2010, working on a .NET 4.0 MVC 3 project if it helps.

@Fa-C-Shus
Copy link

@Fa-C-Shus Fa-C-Shus commented Sep 23, 2013

Visual Studio 2012/Resharper seems to play nice with ForMember

My 2010 Ultimate/Resharper is angered by ForMember

On 9/22/2013 8:56 PM, Michael Hallock wrote:

We are on visual studio 2010, working on a .NET 4.0 MVC 3 project if
it helps.


Reply to this email directly or view it on GitHub
#381 (comment).

@jbogard
Copy link
Member

@jbogard jbogard commented Sep 23, 2013

Nuts, I don't have VS 2010 installed :P

I guess it would be a little out of place to say, just upgrade to VS 2012?

On Sun, Sep 22, 2013 at 10:37 PM, Paul Erickson notifications@github.comwrote:

Visual Studio 2012/Resharper seems to play nice with ForMember

My 2010 Ultimate/Resharper is angered by ForMember

On 9/22/2013 8:56 PM, Michael Hallock wrote:

We are on visual studio 2010, working on a .NET 4.0 MVC 3 project if
it helps.


Reply to this email directly or view it on GitHub
<
#381 (comment)
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/381#issuecomment-24897561
.

@bryancrosby
Copy link

@bryancrosby bryancrosby commented Oct 16, 2013

I am also having the same issue. R# 8.0.1000.2286 2013-09-05T16:18:00 and Visual Studio 2010 Premium (10.0.40219.1 SP1Rel). Has anyone been able to resolve this or know of any open issues @ JetBrains?

@zebenir
Copy link

@zebenir zebenir commented Nov 15, 2013

I agree with the above... VS 2010 Ultimate with Resharper... I can't even get the member names when I type
.ForMember(d => d.

@xlegalles
Copy link

@xlegalles xlegalles commented Dec 9, 2013

Same problem: VS2010 Pro 10.0.40219/R# 8.0.2000.2660

@ishimmings
Copy link

@ishimmings ishimmings commented Dec 12, 2013

Me too. I wrote a similar method declaration with an Expression as a parameter and it worked fine. Not quite sure what that indicates...

Unfortunately at this client we're stuck with VS2010 for the foreseeable.

@dimkaspb
Copy link

@dimkaspb dimkaspb commented Feb 17, 2014

I am seeing the same issue with VS2012 Professional 11.0.50727.1 and R# 8.1.23.546

@jbogard
Copy link
Member

@jbogard jbogard commented Feb 18, 2014

I'm not seeing it with VS2012 Pro 11.0.61030.00 Update 4, R# 8.1.23.546 and
NOT seeing it. What kind of configuration options are you using? ForMember
works fine.

On Mon, Feb 17, 2014 at 5:18 PM, dimkaspb notifications@github.com wrote:

I am seeing the same issue with VS2012 Professional 11.0.50727.1 and R#
8.1.23.546

Reply to this email directly or view it on GitHubhttps://github.com//issues/381#issuecomment-35332283
.

@dimkaspb
Copy link

@dimkaspb dimkaspb commented Feb 18, 2014

Fixed for now. Here is what I did:

  1. Updated to VS2012 Pro 11.0.61030.00 Update 4. The problem remained.
  2. Uninstalled R# and installed a clean version from scratch. The problem remained.
  3. Suspended R# in Tools->Options->Resharper and closed VS.
  4. Deleted R# cache folder for the solution in "C:\Users\XXX\AppData\Local\JetBrains\ReSharper\v8.1\SolutionCaches"
  5. Opened VS and resumed R# in Tools->Options->Resharper. The problem remained.
  6. Restarted VS again and it finally worked!
@hazzik
Copy link
Contributor

@hazzik hazzik commented Feb 18, 2014

So then it should be reported to JetBrains, as it seems that R# caches
assemblies only by name and version ( as I understand now assembly version
remains the same )

@dimkaspb
Copy link

@dimkaspb dimkaspb commented Feb 18, 2014

I have opened a support ticket with JetBrains. Let's see what they say about it...

@jbogard
Copy link
Member

@jbogard jbogard commented Mar 12, 2014

@dimkaspb any word on the support ticket? Do you have a link to it?

@mgrogan01
Copy link

@mgrogan01 mgrogan01 commented Mar 23, 2014

I solved this issue by upgrading to the latest version of ReSharper if anyone still has this problem. (VS2012 11.0.61030.00 update 4 -- Resharper 8.2.0.2160)

@moconnor33
Copy link

@moconnor33 moconnor33 commented Mar 25, 2014

latest version of Resharper did not work for me. - Resharper 8.2.0.2160. But i'm a VS version behind mgrogan01 - i have vs professional 2012 11.0.50727.1

@Roly67
Copy link

@Roly67 Roly67 commented Apr 15, 2014

Still getting this in JetBrains ReSharper 8.2 Full Edition
Build 8.2.0.2160 on 2014-03-20T18:53:08 with VS 2013

Have raised a ticket #8216 with Jetbrains.

Will advise...

@jbogard
Copy link
Member

@jbogard jbogard commented Apr 15, 2014

Do you have a link? Is that on their YouTrack?

On Tue, Apr 15, 2014 at 10:06 AM, Roly67 notifications@github.com wrote:

Still getting this in JetBrains ReSharper 8.2 Full Edition
Build 8.2.0.2160 on 2014-03-20T18:53:08 with VS 2013

Have raised a ticket #8216 with Jetbrains.

Will advise...


Reply to this email directly or view it on GitHubhttps://github.com//issues/381#issuecomment-40492842
.

@Roly67
Copy link

@Roly67 Roly67 commented Apr 16, 2014

Here's the response I got from Jetbrains.

It's obviously a tricky one to reproduce!

Not sure where to go from here with Jetbrains.

My sample project to reproduce the error is @

https://dl.dropboxusercontent.com/u/32051584/ResharperAutoMapperFault.zip

There's definitely something strange going on...


Alexander Kurakin (JetBrains ReSharper Support)

Apr 16 15:54

Hello

Thank you for the report.

I checked it in ReSharper 8.2.1 private build and did not notice any error there - http://screencast.com/t/zfd67exF.

So, could you please download this private development build [url deleted].msi, clean ReSharper caches http://resharper-support.jetbrains.com/entries/23853492-ReSharper-stopped-working-for-a-single-specific-solution and check the issue again.

Thank you.

Alexander Kurakin
Support Engineer
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

@jbogard
Copy link
Member

@jbogard jbogard commented Apr 16, 2014

@Roly67 did you try the suggestion here? #381 (comment)

@Roly67
Copy link

@Roly67 Roly67 commented Apr 16, 2014

@jbogard

Yes, I tried clearing caches, disabling R#, uninstalling in the exact same sequence. Same result...

@David-Brabant
Copy link

@David-Brabant David-Brabant commented Apr 16, 2014

@jbogard
Did try the suggestion. Doesn't work.

@jbogard
Copy link
Member

@jbogard jbogard commented Apr 16, 2014

image

@Roly67
Copy link

@Roly67 Roly67 commented Apr 16, 2014

@jbogard

I guess we're at the clutching at straws stage then:)

Yes, just done a re-start. Same...

@martinjt
Copy link

@martinjt martinjt commented Apr 16, 2014

We just had the same problem, unloading the project then reloading it worked for us...

Maybe that forces resharper to do something in the background?

@gabrielfuller
Copy link

@gabrielfuller gabrielfuller commented Apr 16, 2014

I tried unloading then reloading the project as well and that worked. How strange.

@David-Brabant
Copy link

@David-Brabant David-Brabant commented Apr 16, 2014

Unloading and reloading the project didn't work for me. I also updated my R# to the latest version, and did all what has been suggested above. Without success. I'm using VS 2013, R# 8.2, AutoMapper 3.2.0 (whichI updated this morning). Prior to AutoMapper 3.2.0 everything was working fine. Although I've seen messages on StackOverflow which seems to be related to previous versions of AutoMapper. Very strange. My projects are based on .Net 4.5.1.

@dimkaspb
Copy link

@dimkaspb dimkaspb commented Apr 16, 2014

@jbogard Sorry, took a while to respond here...

The response I got back from JetBrains after filing a ticket was that they are glad I got it resolved, although I am not sure why it was resolved this way. Here is what fixed it for me again:

Updated to VS2012 Pro 11.0.61030.00 Update 4. The problem remained.
Uninstalled R# and installed a clean version from scratch. The problem remained.
Suspended R# in Tools->Options->Resharper and closed VS.
Deleted R# cache folder for the solution in "C:\Users\XXX\AppData\Local\JetBrains\ReSharper\v8.1\SolutionCaches"
Opened VS and resumed R# in Tools->Options->Resharper. The problem remained.
Restarted VS again and it finally worked!

I haven't seen this problem come back yet.

@ghost
Copy link

@ghost ghost commented Apr 16, 2014

It is happening to me with Version 3.2
I downgraded to 3.0 and is working well
For me will even not compile at all

@jbogard
Copy link
Member

@jbogard jbogard commented Apr 16, 2014

Compiling is a completely different story. Can you open a new issue with
your compiler error?

On Wed, Apr 16, 2014 at 1:35 PM, guillenix notifications@github.com wrote:

It is happening to me with Version 3.2
I downgraded to 3.0 and is working well
For me will even not compile at all


Reply to this email directly or view it on GitHubhttps://github.com//issues/381#issuecomment-40635379
.

@ghost
Copy link

@ghost ghost commented Apr 16, 2014

yup, i will downgrade and paste all the info

@ghost
Copy link

@ghost ghost commented Apr 16, 2014

Done! I broke it so you can view the error

#502

#502

@hazzik
Copy link
Contributor

@hazzik hazzik commented Apr 16, 2014

Tried everything suggested - does not work:(

@Roly67
Copy link

@Roly67 Roly67 commented Apr 17, 2014

Ok, I've done some more investigation.

Out of 4 workstations with very similar configurations, we see this happening on 3. I'm not sure what it is about the fourth workstation that makes it work (I wish I knew!).

Tried everything recommended in this thread (including unloading / reloading project) as well as recommendations from my JetBrains ticket (see above) but nothing works.

The next phase of investigation was to revert AutoMapper to a previous version. Results as follows:

-v3.0.0 - works fine (i.e. no squigly lines in R#)
-Tried all CI versions from 3.0.0 upwards to find the version that breaks R# and found it's version 3.2.0-ci1021 that breaks R#.

Perhaps analysing the diffs between 3.2.0-ci1017 and 3.2.0-ci1021 will provide a further clue to this mystery?

@David-Brabant
Copy link

@David-Brabant David-Brabant commented Apr 17, 2014

Reverted to 3.1.1 and things work perfectly.

@Roly67
Copy link

@Roly67 Roly67 commented Apr 17, 2014

@jbogard

Getting closer in this investigation now;)

Have downloaded the AutoMapper source code and, using version control, have identified the source of the problem.

There is what appears to be an environmental related fault introduced between the following commits:

Trying to compile the 4th April build yields the following errors:

Warning 1   The reference assemblies for framework ".NETPortable,Version=v4.0,Profile=Profile328" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.    AutoMapper

Warning 2   There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. AutoMapper

It seems as if the problems occurred around the "Adding WPA81" commit which aligns with the general dates of the 3.2.0-ci1021 commit in NuGet.

My suspicion is that the R# / AutoMapper problem is caused by having or not having a particular version of NetPortable SDK on affected workstations. This would be consistent with observations of some people seeing the problem whilst others are unaffected. If this is the case, the problem and resolution is with AutoMapper (not Jetbrains / R#).

Have spent quite a bit of time on this so far;) Hope this helps and thanks for a great library in AutoMapper.

@David-Brabant
Copy link

@David-Brabant David-Brabant commented Apr 17, 2014

@Roly67 I confirm that I don't have the .NET portable SDK on my machine. Thanks for your investigations (and thanks for AutoMapper too :-) )

@bcronje
Copy link
Contributor

@bcronje bcronje commented Apr 17, 2014

I'm also having this issue. VS 2013 with Resharper 8.2. Tried everything including uninstalling and re-installing Resharper. Hopefully @Roly67 comment above about the .NETPortable leads to a fix.

@kampilan
Copy link

@kampilan kampilan commented Apr 17, 2014

Nothing worked for my case (VS2013 latest Resharper). I reverted to 3.1.1 and all is fine

@devshorts
Copy link

@devshorts devshorts commented Apr 21, 2014

Chiming in here, unloading and reloading the project also worked for me. I originally deleted the R# solution cache but it didn't make a difference.

@bcronje
Copy link
Contributor

@bcronje bcronje commented Apr 21, 2014

Unloading and reloading did not work for me. Reverted back to 3.1.1 and all working again.

@jbogard
Copy link
Member

@jbogard jbogard commented Apr 24, 2014

@David-Brabant
Copy link

@David-Brabant David-Brabant commented Apr 24, 2014

Works for me. Thanks, Jimmy.

@Roly67
Copy link

@Roly67 Roly67 commented Apr 24, 2014

Yes, this has fixed it.

Thanks Jimmy...

@AndreasBeyer
Copy link

@AndreasBeyer AndreasBeyer commented Apr 24, 2014

Perfect. Works for me also. Thanks 👍

@jbogard jbogard added this to the 3.2.1 milestone Apr 24, 2014
@jbogard jbogard added the Bug label Apr 24, 2014
@jbogard jbogard changed the title ForMember angering ReSharper? ForMember angering ReSharper? - Non-existing PCL profile on client machine causing compile/R# errors Apr 24, 2014
@jbogard jbogard closed this Apr 24, 2014
@danielmoore
Copy link

@danielmoore danielmoore commented Jul 3, 2014

This still seems to be an issue in VS2010, but the issue is on Jetbrain's side. Here's the relevant bug: http://youtrack.jetbrains.com/issue/RSRP-417480

@lock
Copy link

@lock lock bot commented May 8, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.