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

.NET CLI not including files under certain directory and not removing other files #1074

Closed
conniey opened this issue Apr 4, 2017 · 4 comments
Milestone

Comments

@conniey
Copy link
Member

conniey commented Apr 4, 2017

I upgraded a solution from VS2015 to VS2017 using the migration tool. When I try to compile my project for netstandard1.6, it cannot find certain files even though they are under the same directory. In addition, it is not excluding some files that are stated in my csproj.

Repro steps:

  1. Clone: https://github.com/conniey/lucenenet/tree/vs2017
  2. dotnet restore Lucene.Net.Portable.sln
  3. cd .\src\Lucene.Net
  4. dotnet build .\Lucene.Net.csproj -f netstandard1.6

Expected
It builds. (dotnet build .\Lucene.Net.csproj -f net451 builds correctly)

Actual

I get a bunch of errors below:

Support\StreamUtils.cs(2,47): error CS0234: The type or namespace name 'Binary' does not exist in the namespace 'System.Runtime.Serialization.Formatters' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Analysis\Analyzer.cs(71,18): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\DocumentsWriterPerThread.cs(31,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\IndexUpgrader.cs(26,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\IndexWriter.cs(37,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\UpgradeIndexMergePolicy.cs(23,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Store\FSDirectory.cs(26,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Store\MMapDirectory.cs(26,39): error CS0234: The type or namespace name 'Constants' does not exist in the namespace 'Lucene.Net.Util' (are you missing an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Codecs\Lucene3x\TermInfosReader.cs(48,26): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(70,27): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(87,27): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(104,27): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(72,52): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(81,60): error CS0115: 'SegmentCoreReaders.AnonymousFieldsReaderLocal.InitialValue()': no suitable method found to override [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(89,51): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(98,59): error CS0115: 'SegmentCoreReaders.AnonymousTermVectorsLocal.InitialValue()': no suitable method found to override [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(106,73): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentCoreReaders.cs(112,69): error CS0115: 'SegmentCoreReaders.DisposableThreadLocalAnonymousInnerClassHelper3.InitialValue()': no suitable method found to override [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(61,27): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(75,27): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(63,72): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(69,69): error CS0115: 'SegmentReader.DisposableThreadLocalAnonymousInnerClassHelper.InitialValue()': no suitable method found to override [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(77,73): error CS0246: The type or namespace name 'DisposableThreadLocal<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Index\SegmentReader.cs(83,68): error CS0115: 'SegmentReader.DisposableThreadLocalAnonymousInnerClassHelper2.InitialValue()': no suitable method found to override [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Support\Codecs\DefaultCodecFactory.cs(48,40): error CS0246: The type or namespace name 'NamedServiceFactory<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Support\Codecs\DefaultDocValuesFormatFactory.cs(48,50): error CS0246: The type or namespace name 'NamedServiceFactory<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Support\Codecs\DefaultPostingsFormatFactory.cs(48,49): error CS0246: The type or namespace name 'NamedServiceFactory<>' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]
Support\StreamUtils.cs(8,25): error CS0246: The type or namespace name 'BinaryFormatter' could not be found (are you missing a using directive or an assembly reference?) [D:\git\conniey\lucenenet\src\Lucene.Net\Lucene.Net.csproj]

Version info

.NET Command Line Tools (1.0.0)

Product Information:
Version: 1.0.0
Commit SHA-1 hash: e53429f

Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0

@livarcocc livarcocc added this to the 2.0 milestone Apr 6, 2017
@conniey
Copy link
Member Author

conniey commented Apr 7, 2017

Here are those diagnostic build logs you asked for:

@conniey
Copy link
Member Author

conniey commented Apr 7, 2017

@livarcocc
I am able to get it to build if I manually expand the files in the Compile Remove ItemGroup.

Working

  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
    <Compile Remove="Index/ConcurrentMergeScheduler.cs"/>
    <Compile Remove="Support/Deflater.cs"/>
    <Compile Remove="Support/Inflater.cs"/>
    <Compile Remove="Support/SharpZipLib.cs"/>
    <Compile Remove="Support/StreamUtils.cs"/>
  </ItemGroup>

@dsplaisted
Copy link
Member

This looks like an MSBuild bug...

@rainersigwald
Copy link
Member

This issue was moved to dotnet/msbuild#2128

GangWang01 pushed a commit to GangWang01/sdk that referenced this issue Jun 7, 2022
Remove unused rememberMe parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants