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

Intellisense not working for classlib project in .NET Core 2.0 #497

Closed
priort opened this Issue Aug 15, 2017 · 13 comments

Comments

Projects
None yet
4 participants
@priort

priort commented Aug 15, 2017

Hi there,

Thanks for the great work supporting .NET Core 2.0
I can create console and xunit projects and everything works fine. However, when I create a classlib project, I don't get any intellisense.

Windows 10
VsCode
Ionide 2.32.2

dotnet new classlib -o MyLibrary -lang f#
cd MyLibrary
dotnet restore
dotnet build
code .
capture

@Krzysztof-Cieslak

This comment has been minimized.

Show comment
Hide comment
@Krzysztof-Cieslak

Krzysztof-Cieslak Aug 15, 2017

Member

Maybe it's same case as in this Tweet - https://twitter.com/mavnn/status/897493762510815232 - missing Sdk reference in project file?

Member

Krzysztof-Cieslak commented Aug 15, 2017

Maybe it's same case as in this Tweet - https://twitter.com/mavnn/status/897493762510815232 - missing Sdk reference in project file?

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 15, 2017

I can repro with a new .NET Core SDK 2.0-based project. No language service hookup for the library. Works just fine with a console app though.

cartermp commented Aug 15, 2017

I can repro with a new .NET Core SDK 2.0-based project. No language service hookup for the library. Works just fine with a console app though.

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 15, 2017

No real difference in the project files:

Console:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

</Project>

Library:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Library.fs" />
  </ItemGroup>

</Project>

cartermp commented Aug 15, 2017

No real difference in the project files:

Console:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

</Project>

Library:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Library.fs" />
  </ItemGroup>

</Project>
@lambdakris

This comment has been minimized.

Show comment
Hide comment
@lambdakris

lambdakris Aug 15, 2017

I ran in to this and as best as I can tell is that if the target framework is netstandard2.0, it doesn't work, but if it is netcoreapp2.0, it works.

lambdakris commented Aug 15, 2017

I ran in to this and as best as I can tell is that if the target framework is netstandard2.0, it doesn't work, but if it is netcoreapp2.0, it works.

@lambdakris

This comment has been minimized.

Show comment
Hide comment
@lambdakris

lambdakris Aug 15, 2017

...and actually the project type doesn't matter, it could be a console app and as long as the target framework is netstandard2.0, it seems like intellisense doesn't activate. The reason you notice with classlib is that the target framework automatically gets set to netstandard2.0 while for the app style templates the target framework gets set to netcoreapp2.0.

lambdakris commented Aug 15, 2017

...and actually the project type doesn't matter, it could be a console app and as long as the target framework is netstandard2.0, it seems like intellisense doesn't activate. The reason you notice with classlib is that the target framework automatically gets set to netstandard2.0 while for the app style templates the target framework gets set to netcoreapp2.0.

@Krzysztof-Cieslak

This comment has been minimized.

Show comment
Hide comment
@Krzysztof-Cieslak

Krzysztof-Cieslak Aug 15, 2017

Member

Can someone post output from Ionide's logs ?

Member

Krzysztof-Cieslak commented Aug 15, 2017

Can someone post output from Ionide's logs ?

@lambdakris

This comment has been minimized.

Show comment
Hide comment
@lambdakris

lambdakris Aug 16, 2017

Well, all I see is an error parsing the fsproj file, but no details as to why that is...

[21:36:25 DEBUG] REQ (001) -> {project}, File = "~\tryouts.fsproj"
Data={"FileName":"c:\\Users\\admin\\Code\\tryouts\\tryouts.fsproj"}

[21:36:26 DEBUG] RES (001) <- {project} in 1040 ms: Kind={"error"}
Data={"Code":1,"Message":"MSBuild failed with exitCode 1 Working Directory: 'c:\\Users\\admin\\Code\\tryouts' Exe Path: 'dotnet' Args: 'msbuild c:\\Users\\admin\\Code\\tryouts\\tryouts.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp312B.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp312C.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp314C.tmp.GetProperties.txt /nologo /verbosity:quiet'","AdditionalData":{}}

[21:36:26 ERROR] Project loading failed, MSBuild failed with exitCode 1 Working Directory: 'c:\Users\admin\Code\tryouts' Exe Path: 'dotnet' Args: 'msbuild c:\Users\admin\Code\tryouts\tryouts.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\Users\admin\AppData\Local\Temp\tmp312B.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\Users\admin\AppData\Local\Temp\tmp312C.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\Users\admin\AppData\Local\Temp\tmp314C.tmp.GetProperties.txt /nologo /verbosity:quiet' 

lambdakris commented Aug 16, 2017

Well, all I see is an error parsing the fsproj file, but no details as to why that is...

[21:36:25 DEBUG] REQ (001) -> {project}, File = "~\tryouts.fsproj"
Data={"FileName":"c:\\Users\\admin\\Code\\tryouts\\tryouts.fsproj"}

[21:36:26 DEBUG] RES (001) <- {project} in 1040 ms: Kind={"error"}
Data={"Code":1,"Message":"MSBuild failed with exitCode 1 Working Directory: 'c:\\Users\\admin\\Code\\tryouts' Exe Path: 'dotnet' Args: 'msbuild c:\\Users\\admin\\Code\\tryouts\\tryouts.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp312B.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp312C.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\\Users\\admin\\AppData\\Local\\Temp\\tmp314C.tmp.GetProperties.txt /nologo /verbosity:quiet'","AdditionalData":{}}

[21:36:26 ERROR] Project loading failed, MSBuild failed with exitCode 1 Working Directory: 'c:\Users\admin\Code\tryouts' Exe Path: 'dotnet' Args: 'msbuild c:\Users\admin\Code\tryouts\tryouts.fsproj /p:SkipCompilerExecution=true /p:ProvideCommandLineArgs=true /p:CopyBuildOutputToOutputDirectory=false /p:UseCommonOutputDirectory=true /t:_Inspect_FscArgs /p:_Inspect_FscArgs_OutFile=C:\Users\admin\AppData\Local\Temp\tmp312B.tmp.FscArgs.txt /p:DesignTimeBuild=true /t:_Inspect_GetResolvedProjectReferences /p:_Inspect_GetResolvedProjectReferences_OutFile=C:\Users\admin\AppData\Local\Temp\tmp312C.tmp.GetResolvedProjectReferences.txt /t:_Inspect_GetProperties /p:_Inspect_GetProperties_OutFile=C:\Users\admin\AppData\Local\Temp\tmp314C.tmp.GetProperties.txt /nologo /verbosity:quiet' 
@priort

This comment has been minimized.

Show comment
Hide comment
@priort

priort Aug 16, 2017

extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (001) -> {project}, File = "~\MyLib.fsproj"
Data=Object
extensionHost.ts:335 [Extension Host] [msbuild] MSBuild (.NET) found at C:\Program Files (x86)\\MSBuild\14.0\Bin\MSBuild.exe
extensionHost.ts:335 [Extension Host] [msbuild] Dotnet cli (.NET Core) found at C:\Program Files\dotnet\dotnet.exe
extensionHost.ts:335 [Extension Host] [msbuild] MSBuild (.NET) activated
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (001) <- {project} in 503 ms: Kind={"project"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (002) -> {parse}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (002) <- {parse} in 1549 ms: Kind={"error"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] Cannot execute parse, The file 'c:\Users\prior\OneDrive\d\dotnetCoreProjs\MyLib\Library.fs' was not part of the project. Did you call InvalidateConfiguration when the list of files in the project changed? 
extensionHost.ts:335 [Extension Host] [icons] Loading icon theme from C:\Users\prior\.vscode\extensions\robertohuertasm.vscode-icons-7.12.0\out\src\icons.json
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (003) -> {project}, File = "~\MyLib.fsproj"
Data=Object
extensionHost.ts:335 [Extension Host] Output omitted for a large object that exceeds the limits
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (003) <- {project} in 7 ms: Kind={"project"}
Data=Object
extensionHost.ts:335 [Extension Host] Startup took: 2584.000000 ms
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (004) -> {declarations}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (005) -> {lint}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (005) <- {lint} in 12 ms: Kind={"info"}
Data=Cached typecheck results not yet available

priort commented Aug 16, 2017

extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (001) -> {project}, File = "~\MyLib.fsproj"
Data=Object
extensionHost.ts:335 [Extension Host] [msbuild] MSBuild (.NET) found at C:\Program Files (x86)\\MSBuild\14.0\Bin\MSBuild.exe
extensionHost.ts:335 [Extension Host] [msbuild] Dotnet cli (.NET Core) found at C:\Program Files\dotnet\dotnet.exe
extensionHost.ts:335 [Extension Host] [msbuild] MSBuild (.NET) activated
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (001) <- {project} in 503 ms: Kind={"project"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (002) -> {parse}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (002) <- {parse} in 1549 ms: Kind={"error"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] Cannot execute parse, The file 'c:\Users\prior\OneDrive\d\dotnetCoreProjs\MyLib\Library.fs' was not part of the project. Did you call InvalidateConfiguration when the list of files in the project changed? 
extensionHost.ts:335 [Extension Host] [icons] Loading icon theme from C:\Users\prior\.vscode\extensions\robertohuertasm.vscode-icons-7.12.0\out\src\icons.json
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (003) -> {project}, File = "~\MyLib.fsproj"
Data=Object
extensionHost.ts:335 [Extension Host] Output omitted for a large object that exceeds the limits
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (003) <- {project} in 7 ms: Kind={"project"}
Data=Object
extensionHost.ts:335 [Extension Host] Startup took: 2584.000000 ms
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (004) -> {declarations}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] REQ (005) -> {lint}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (005) <- {lint} in 12 ms: Kind={"info"}
Data=Cached typecheck results not yet available
@priort

This comment has been minimized.

Show comment
Hide comment
@priort

priort Aug 16, 2017

that was on window reload

priort commented Aug 16, 2017

that was on window reload

@priort

This comment has been minimized.

Show comment
Hide comment
@priort

priort Aug 16, 2017

Then when I type . as in System. in my fs source file in my class library, logs are:

[Extension Host] [IONIDE-FSAC] REQ (013) -> {parse}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (013) <- {parse} in 29 ms: Kind={"error"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] Cannot execute parse, The file 'c:\Users\prior\OneDrive\d\dotnetCoreProjs\MyLib\Library.fs' was not part of the project. Did you call InvalidateConfiguration when the list of files in the project changed? 

priort commented Aug 16, 2017

Then when I type . as in System. in my fs source file in my class library, logs are:

[Extension Host] [IONIDE-FSAC] REQ (013) -> {parse}, File = "~\Library.fs"
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] RES (013) <- {parse} in 29 ms: Kind={"error"}
Data=Object
extensionHost.ts:335 [Extension Host] [IONIDE-FSAC] Cannot execute parse, The file 'c:\Users\prior\OneDrive\d\dotnetCoreProjs\MyLib\Library.fs' was not part of the project. Did you call InvalidateConfiguration when the list of files in the project changed? 
@priort

This comment has been minimized.

Show comment
Hide comment
@priort

priort Aug 16, 2017

My fsproj does include Library.fs though

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Library.fs" />
  </ItemGroup>

</Project>

priort commented Aug 16, 2017

My fsproj does include Library.fs though

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Library.fs" />
  </ItemGroup>

</Project>
@Krzysztof-Cieslak

This comment has been minimized.

Show comment
Hide comment
@Krzysztof-Cieslak

Krzysztof-Cieslak Aug 16, 2017

Member

Known upstream issue tracked in fsharp/FsAutoComplete#180

Member

Krzysztof-Cieslak commented Aug 16, 2017

Known upstream issue tracked in fsharp/FsAutoComplete#180

@priort

This comment has been minimized.

Show comment
Hide comment
@priort

priort Aug 16, 2017

Okay no worries, thanks for investigating.

priort commented Aug 16, 2017

Okay no worries, thanks for investigating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment