I am trying to add a reference to a WCF service in my project but whenever I do it, the classes in the Reference.cs file have the attribute [Microsoft.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.0.3-preview3.21351.2")]
on top of it instead of [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
(which I usually see in other projects).
The problem is that the assemblies for Microsoft.CodeDom can't be found. I found a nuget package named Microsoft.CodeDom.Providers.DotNetCompilerPlatfor but it is not compatible with .NET 5.
Also using a pre-release version of a package seems weird (2.0.3-preview3.21351.2).
Would anyone know why Visual Studio is generating that odd Reference.cs file?
If I try to add a reference to the same WCF service in a .NET Framework 4.8 project the Reference.cs file is generated as expected (using the attribute [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")]
).
Here is the information about my Visual Studio installation
Microsoft Visual Studio Professional 2019 Version 16.11.3 VisualStudio.16.Release/16.11.3+31702.278 Microsoft .NET Framework Version 4.8.04084
Installed Version: Professional
.NET Core Debugging with WSL 1.0 .NET Core Debugging with WSL
ASP.NET and Web Tools 2019 16.11.75.64347 ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.11.75.64347 For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.11.75.64347 Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 16.11.75.64347 Azure Functions and Web Jobs Tools
C# Tools 3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure Tools for Visual Studio 2.9 Support for Azure Cloud Services projects
Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.1.113+g422d40002e.RR Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.2 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Node.js Tools 1.5.30526.3 Commit Hash:c09c81113bcbc86d57943fcdd67e82434263d61d Adds support for developing and debugging Node.js apps in Visual Studio
NuGet Package Manager 5.11.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info
Razor (ASP.NET Core)
16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725 Provides languages services for ASP.NET Core Razor.SQL Server Data Tools 16.0.62107.28140 Microsoft SQL Server Data Tools
TypeScript Tools 16.0.30526.2002 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools
3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.Visual F# Tools
16.11.0-beta.21322.6+488cc578cafcd261d90d748d8aaa7b8b091232dc Microsoft Visual F# ToolsVisual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Container Tools Extensions 1.0 View, manage, and diagnose containers within Visual Studio.
Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers