Visual Studio Project System encountered an error

4

I have an ASP.NET Core 2.1 API project with Docker for Windows Support that used to load/build/run fine until a few days back but now it throws me an error as soon as I load the solution in Visual Studio Enterprise 2017 Version 15.9.0 Preview 6.0

Here is the error: Project System error

Here is the information from the diagnostic log mentioned in the error:

Recoverable System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

at EnvDTE.Projects.Item(Object index)

at Microsoft.VisualStudio.Docker.Shared.HierarchyExtensions.IsInStartupProjects(Hierarchy hierarchy, IServiceProvider serviceProvider)

at Microsoft.VisualStudio.Docker.Compose.ProjectSystem.ProjectLoadHandler.d__31.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.VisualStudio.ProjectSystem.UnconfiguredProjectImpl.AutoLoadMethodStateMachine.<b__8_0>d.MoveNext()

Finally, here is the project file:

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

      <PropertyGroup>
        <TargetFramework>netcoreapp2.1</TargetFramework>
        <DockerDefaultTargetOS>Windows</DockerDefaultTargetOS>
        <UserSecretsId>d0fb3109-adbd-446a-ab61-283a4cce9594</UserSecretsId> 
        <DockerComposeProjectPath>..\..\..\docker
        compose.dcproj</DockerComposeProjectPath>
      </PropertyGroup>

      <ItemGroup>
        <Folder Include="wwwroot\" />
      </ItemGroup>

      <ItemGroup>
        <PackageReference Include="AutoMapper" Version="7.0.1" />
        <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="5.0.1" />
        <PackageReference Include="CorrelationId" Version="2.1.0" />
        <PackageReference Include="FluentValidation" Version="8.0.100" />
        <PackageReference Include="FluentValidation.AspNetCore" Version="8.0.100" />
        <PackageReference Include="Microsoft.AspNetCore.App" />
        <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.0.2105168" />
        <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
        <PackageReference Include="prometheus-net.AspNetCore" Version="2.1.3" />
        <PackageReference Include="Serilog.AspNetCore" Version="2.1.1" />
        <PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
      </ItemGroup>

      <ItemGroup>
        <ProjectReference Include="..\..\Dlls\Co.Bll.PostService\Co.Bll.PostService.csproj" />
        <ProjectReference Include="..\..\Dlls\Co.Dal\Co.Dal.Posts.csproj" />
        <ProjectReference Include="..\..\Dlls\Co.Dtos\Co.Dtos.csproj" />
        <ProjectReference Include="..\..\Dlls\Co.Framework\Co.Framework.csproj" />
      </ItemGroup>

    </Project>

I even commented the Docker related property group items and rebuilt the solution but it didn't work. Furthemore, when I run the API locally in Chrome, I get the following error message:

Runtime error

Can anyone tell me what's wrong with the project file and how do I fix it?

c#
docker
visual-studio-2017
asp.net-core-2.1
asked on Stack Overflow Nov 19, 2018 by Yasir

1 Answer

0

https://developercommunity.visualstudio.com/content/problem/382613/systemargumentexception-the-parameter-is-incorrect.html

We have fixed the problem in an upcoming release. This is planned to go out in an upcoming servicing update to VS2017, currently planned for 15.9.4.


User contributions licensed under CC BY-SA 3.0