lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Potthast" <>
Subject RE: Failing to compile almost all of the solutions projects in Visual Studio
Date Fri, 29 May 2020 12:46:19 GMT
Hi Shad,

Thank you for your fast answer.

Since I'm using the most current Visual Studio (Version 16.6.0), this
shouldn't be the problem in my case. I need to "read into" the info you gave
me and see if I manage to solve my problems.

I'll report back, one way or the other. :-)  


-----Original Message-----
From: Shad Storhaug <> 
Sent: Freitag, 29. Mai 2020 13:13
Subject: RE: Failing to compile almost all of the solutions projects in
Visual Studio

Hi Jens,

Based on the error messages, it sounds like the InternalsVisibleTo
attributes aren't being generated. We have recently changed from having them
hard-coded in AssemblyInfo.cs files to having MSBuild generate them in this

Since you are able to build on the command line, I suspect the problem you
are experiencing is due to an older Visual Studio 2019 version that for some
reason is failing to execute the AddInternalsVisibleTo target. The prime
suspect, IMO is the BeforeTargets="CoreCompile" attribute, in which the
CoreCompile target may not exist in older MSBuild pipelines than what we
have tested on.

<Target Name="AddInternalsVisibleTo" BeforeTargets="CoreCompile" Label="Adds
InternalsVisibleTo Attribute and PublicKey (if supplied)">

According to, there may be other ways
of doing this that are more reliable, but we adapted the solution from this
blog post:

The only thing that is required is for that target to execute before the
compilation happens so the generated InternalsVisibleTo attributes are
included in the build (and with the public key, since our assemblies are
strong named). So, if you can find a solution that works in your version of
Visual Studio, please submit a PR with the fix.

Shad Storhaug (NightOwl888)
Project Chairperson - Apache Lucene.NET

-----Original Message-----
From: Jens Potthast <> 
Sent: Friday, May 29, 2020 4:52 PM
Subject: Failing to compile almost all of the solutions projects in Visual

Hi all,

After cloning the repository (, I
fail to compile the solution within Visual Studio. Out of 64 projects, only
three can be compiled successfully. On the command line using the build
command as described here:, however, all
projects can be compiled. 

The errors are mostly error CS0122 ('xyz' is inaccessible due to its
protection level) and error CS0507 (cannot change access modifiers when
overriding 'protected internal' inherited member). 

Since I get hundreds of these errors, I might have missed something
fundamental. Can someone please advise me what additional settings I need to
make or which additional components need to be installed?

Searching the mailing lists (user/dev), I didn't find any clues or starting


View raw message