c# - 无法启动 .NET 应用程序,ConfigurationErrorsException

标签 c# .net winforms .net-3.5

出于测试目的,我安装了一个干净的 XP 虚拟机,仅应用了 .NET 3.5 SP1 可再发行组件。

当我尝试启动我们的 WinForms 应用程序时,出现以下异常:

System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 134)

该应用程序可以在其他系统上运行,我以前从未见过。特别有趣的是,它是一台“只”安装了 XP 和 .NET 3.5 的干净机器。我们也没有在应用中明确使用 WCF。

我在一些论坛上看到他们从 machine.config 中删除了一个部分,但在全新安装时必须这样做感觉不对,应该有更好的解决方案。有什么想法吗?

最佳答案

看起来像是安装问题。 Connect 上出现错误。

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=323659

这是 Microsoft 的官方推荐:

与此同时,您应该可以通过运行来修复您的安装:

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe"/r/x

%windir%\Microsoft.NET\Framework\v3.5\WFServicesReg.exe/c

关于c# - 无法启动 .NET 应用程序,ConfigurationErrorsException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1292413/

相关文章:

C#双缓冲按钮

c# - 引入 Visual Studio 2015 的问题

c# - 系统.MissingMethodException : Method 'MvvmCross.Droid.Views.MvxAndroidViewPresenter..ctor' not found

.net - Microsoft ACE 驱动程序更改了程序其余部分的浮点精度

c# - 在 xmlns clr 命名空间 : 中找不到 Xamarin Forms 抛出异常

c# - 在 WinForms 中绑定(bind)到 WPF 托管控件的 DependencyProperty

C#跨线程调用问题

c# - WPF MVVM : ItemTemplate for binding a list of ICommands to a ListBox

c# - 为asp.net MVC3项目配置log4net

C# 通过反射将派生类转换为基类异常