Open abhijitparkhi1983 opened 6 years ago
Tagging @DustinCampbell
@DustinCampbell looking forward to hear from you on this issue.
@DustinCampbell looking forward to hear from you on this issue. Guys pls give some leads.
Roslyn team,
Its getting difficult to move ahead without getting a support from the members of Roslyn development team. @jcouv and @DustinCampbell , it will be helpful if you guys can assign some one else to give inputs on this issue.
@abhijitparkhi1983
I would start with looking at MSBuildWorkspace.Diagnostics
like so:
using (var workspace = MSBuildWorkspace.Create())
{
workspace.LoadMetadataForReferencedProjects = true;
Project currentProject = workspace.OpenProjectAsync(projectPath).Result;
ImmutableList<WorkspaceDiagnostic> diagnostics = workspace.Diagnostics;
foreach(var diagnostic in diagnostics)
{
Console.Writeline(diagnostic.Message);
}
}
That should tell you what is going wrong.
If I had to take a guess I would say that the version of MSBuild
that MSBuildWorkspace
is using to load the projects is from VS 2015 not VS 2017. Globbing (the feature being used in https://github.com/OmniSharp/omnisharp-roslyn/tree/master/src/OmniSharp.Abstractions/OmniSharp.Abstractions.csproj so it doesn't need to specify compile includes) is only available in the VS 2017 version of MSBuild.
I have the same problem. I have found several projects for which not any documents are returned. For example: https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json.sln. MSBuildWorkspace.Diagnostics is empty. This looks like a showstopper issue for a Roslyn based Windows Store app I was planning to publish. Is there any workaround?
I had similar error. In my case MSBuild diagnostics returned:
Msbuild error while processing file "..." with the message: MSB0001: Internal MSBuild Error: Type information for Microsoft.Build.Utilities.ToolLocationHelper was present in the whitelist cache as Microsoft.Build.Utilities.ToolLocationHelper, Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a but the type could not be loaded. unexpectedly null
Installing Nuget Package Microsoft.Build.Tasks.Core fixed the issue (MSBuild errors didn't disappeared entirely, but it started to return list of documents correctly for both VS2012 and VS2017 projects).
MSDN-WhiteKnig - diagnostics did not show any error for me but documents count was 0. However installing Microsoft.Build.Tasks.Core solved issue and now i am getting documents. Thanks.
I am hitting the same issue and my diagnostics gives the error
Msbuild failed when processing the file 'C:\Users\akagarw\AppData\Local\Temp\1v4lhsxn.uii\1v4lhsxn.uii.csproj' with message: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\Users\akagarw\AppData\Local\Temp\1v4lhsxn.uii\1v4lhsxn.uii.csproj
This is my project file
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RootNamespace>_1v4lhsxn.uii</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NewtonSoft.json" Version="1.0.0" />
</ItemGroup>
</Project>
The issue that I am hitting is possibly related to : https://github.com/OmniSharp/omnisharp-vscode/issues/2937
I have solved this by instaling MsBuild packages from nuget
2019-03-26, an, 23:02 Akshita Agarwal notifications@github.com rašė:
I am hitting the same issue and my diagnostics gives the error
Msbuild failed when processing the file 'C:\Users\akagarw\AppData\Local\Temp\1v4lhsxn.uii\1v4lhsxn.uii.csproj' with message: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\Users\akagarw\AppData\Local\Temp\1v4lhsxn.uii\1v4lhsxn.uii.csproj
This is my project file
Exe netcoreapp3.0 _1v4lhsxn.uii
The issue that I am hitting is possibly related to : OmniSharp/omnisharp-vscode#2937 https://github.com/OmniSharp/omnisharp-vscode/issues/2937
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dotnet/roslyn/issues/25370#issuecomment-476870454, or mute the thread https://github.com/notifications/unsubscribe-auth/ADvMlzWnc9SpO_8VFQ4S2MCUnjPnt9oOks5vapj-gaJpZM4SkO5r .
--
Pagarbiai,
Vytautas Pranskunas
Microsoft.Build.Tasks.Core
Thanks!!
Version Used: 2.7.0
Steps to Reproduce:
We are trying to open a ".csproj" project using Roslyn's code below:
Expected Behavior: Documents should be available.
Actual Behavior: No Documents present