wcf icon indicating copy to clipboard operation
wcf copied to clipboard

dotnet-svcutil failing when the project references a project reference to a .vbproj project

Open abannsunny opened this issue 3 years ago • 2 comments

We recently updated our .net 4.5 project to .net 4.8 and choose to update the project file to an SDK style project and that broke our service references. We cannot update the service references anymore from visual studio.

After a long search found this link to a community issue and that pointed us to us the "dotnet-svcutil" cli tool

This is how our project file looks like:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <OutputPath>..\..\..\Binaries\</OutputPath>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="pkg.1" Version="2.2.2" />
    <PackageReference Include="pkg.2" Version="1.1.1" />
   ----
-----
------
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\..\..\folder1\folder2\project1.vbproj" />
    <ProjectReference Include="..\..\..\folder3\folder4\project2.csproj" />
 ----
----
----
  </ItemGroup>
  <ItemGroup>
    <Reference Include="System.ServiceModel" />
  </ItemGroup>
</Project>

Tried to run the svcutil tool to update the service reference of one of the service references and we are running into this error:

pathtoprojectfile>dotnet-svcutil -u ServiceReferenceName
Microsoft (R) WCF Service Model Proxy Generation Tool for .Net Core platform
[Microsoft.Tools.ServiceModel.Svcutil, Version 2.0.3]
Copyright (c) Microsoft Corporation.  All rights reserved.

This tool collects information about how it is used in order to improve the tool. This functionality can be disabled by setting the environment variable "DOTNET_SVCUTIL_TELEMETRY_OPTOUT" to 1.

Error: The specified parameter value '..\..\..\folder1\folder2\project1.vbproj' is not valid. Parameter name: 'filePath'.

If you would like more help, type "dotnet-svcutil -h"

Is this because we have a vb project referenced? Is there any workaround for this issue?

abannsunny avatar Feb 08 '22 23:02 abannsunny

@abannsunny have you tried to use svcutil.exe on your project before upgrade to .net 4.8? I am wondering whether this is a regression from .NET framework or not.

A bit background, svcutil.exe ships with Visual Studio, as .NET SDK, it's generally used for .NET framework project. dotnet-svcutil.exe is targeting .NET Core or SDK style project.

HongGit avatar Jun 24 '22 04:06 HongGit

@abannsunny could you please try to create a new c# project to add the service reference, then source include the generated file in your intended project?

Please use above suggestion as a workaround when we are investigating a solution.

HongGit avatar Aug 31 '22 21:08 HongGit