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

Cannot access internal class "ThisAssembly" here #55

Closed
RobSmyth opened this issue Sep 25, 2017 · 16 comments
Closed

Cannot access internal class "ThisAssembly" here #55

RobSmyth opened this issue Sep 25, 2017 · 16 comments

Comments

@RobSmyth
Copy link

Hi,

Resharper raises errors "Cannot access internal class 'ThisAssembly' here" for each reference to ThisAssembly in the AssemblyInfoExt.cs file. The project does compile and run so it evidently does work.

I toss up as to if this is a Resharper issue or something GitInfo can fix. Anybody else seeing this?

@MaikuMori
Copy link

Having same issue. It used to work before, no idea what caused it to break.

@kzu
Copy link
Member

kzu commented Dec 9, 2017

If you could figure out what version it broke on, maybe we can track what's different?

@MaikuMori
Copy link

It probably broke on some version of Rider, not GitInfo. I'm using the nightly build. I'll try to experiment with some GitInfo versions.

@RobSmyth
Copy link
Author

It seems (not sure) to happen when I have multiple projects using GitInfo in the one solution and one project referencing the other.

@MaikuMori
Copy link

My project setup is something like:

  • Main solution
    • App 1 (uses GitInfo, missing assembly in Rider)
    • App 2 (doesn't use GitInfo)

@RobSmyth
Copy link
Author

Another scenario were I've hit this issue ... I have a production code assembly and a matching unit tests code assembly. I use the attribute InternalsVisibleTo in the production code assembly so that the unit tests can access the internal types. Both assemblies use GitInfo. Once I add this attribute my build breaks due to "Cannot access internal class 'ThisAssembly' here" error.

Note: It is possible that if your not using Resharper or you do not have 'treat warnings as errors' etc, you may not see this error.

@MaikuMori
Copy link

MaikuMori commented Dec 30, 2017

I'm working on some components in Windows VM and I have the same problem so this is not platform specific issue. I still think it's really issue in Resharper/Rider rather than in this project,

@kzu
Copy link
Member

kzu commented Dec 30, 2017

@RobSmyth that's sort of expected. You should remove GitInfo from test projects, there's no need for it there.

@RobSmyth
Copy link
Author

Hi, thanks. Yes that is a work around I've gone with.

But to pick you up on:

"there's no need for it"

... true to say that the vast majority of times there is much less need and it could be removed from the test code assembly. Almost always an acceptable limitations (and one that is OK with me). But, if your shipping the test assembly then that is not true.

Thanks,

Rob

@kzu
Copy link
Member

kzu commented Dec 31, 2017

But, if your shipping the test assembly then that is not true.

Yes, it's still true. Just give the test assembly InternalsVisibleTo visibility and you can use the referenced project's ThisAssembly in the test project's AssemblyInfo.cs as usual.

@RobSmyth
Copy link
Author

Ah! Now that is useful as I think it is good for the test assembly (unit tests) to use the production assembly's assembly info. Nice, I think I'll use that.

To take that a step further ... how about I have one version assembly in the solution and all others get their version from that? Will that cause unnecessary extra recompiles?

Thanks.

@kzu
Copy link
Member

kzu commented Dec 31, 2017

@kzu
Copy link
Member

kzu commented Jan 3, 2018

I guess this can be closed @RobSmyth? Not sure there's much GitInfo can do?

@RobSmyth
Copy link
Author

RobSmyth commented Jan 3, 2018

I agree

@RobSmyth RobSmyth closed this as completed Jan 3, 2018
@MaikuMori
Copy link

Just to give heads up for people interested, I reached out to JetBrains and they confirmed and reproduced the problem. Now all we have to do is wait.

@kevin-osborne
Copy link

works ok in rider 2018.2.3

@devlooped devlooped locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants