lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shad Storhaug <s...@shadstorhaug.com>
Subject RE: Failing to compile almost all of the solutions projects in Visual Studio
Date Fri, 29 May 2020 11:13:12 GMT
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 commit:

https://github.com/apache/lucenenet/commit/9e65940b4acdb706b478d446320f02d2a2024ce4

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 https://stackoverflow.com/a/11705503, there may be other ways of doing this that
are more reliable, but we adapted the solution from this blog post: https://www.meziantou.net/declaring-internalsvisibleto-in-the-csproj.htm.

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.

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


-----Original Message-----
From: Jens Potthast <jens.potthast@innovation.uni-bremen.de> 
Sent: Friday, May 29, 2020 4:52 PM
To: dev@lucenenet.apache.org
Subject: Failing to compile almost all of the solutions projects in Visual Studio

Hi all,

After cloning the repository (https://github.com/apache/lucenenet.git), 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: https://github.com/apache/lucenenet,
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 points.

Thanks,
Jens 


Mime
View raw message