sgen TypeLoadException in Visual Studio for Mac when trying to build Xamarin.iOS app
sgen TypeLoadException in Visual Studio for Mac when trying to build Xamarin.iOS app
在 Visual Studio(版本 7.0.1 build 24)中的 MacOS 上编译我们的应用程序时,出现错误:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB6006: "sgen.exe" exited with code 1. (MSB6006) (SyncWebClientLight)
如果我在 Visual Studio 2015 Pro 中开始构建(VS2015 连接到 Mac 并在那里编译),那么我可以调试等。这会很棒,除了我可以'从 VS2015 生成一个存档以提交到 App Store(无论出于何种原因,"Archive" 菜单选项显示为灰色)
有没有办法在 Visual Studio 中为 Mac 禁用 sgen.exe(某些 msbuild 开关或其他东西?)可能有帮助吗?
更新 1:
VS 2015 给出以下错误:
Could not load file or assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) SyncWebClientLight C:\projects\mWORKSPACE\trunk\Source\SyncWebClientLight\SGEN
所以这至少是多一点信息。
更新二:
Target GenerateSerializationAssemblies:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5/sgen.exe /assembly:/Users/mj/Documents/projects/mWORKSPACE/Source/SyncWebClientLight/obj/iPhoneSimulator/Release/SBW.SyncWebClientLight.dll /proxytypes /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/mscorlib.dll /reference:/Users/mj/Documents/projects/mWORKSPACE/Release/SBW.Sync.dll /reference:/Users/mj/Documents/projects/mWORKSPACE/Debug/SBW.SystemBase.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Data.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Web.Services.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
Unhandled Exception:
System.TypeLoadException: Could not load type of field 'SyncWebClientLight.ClientPackageController:_syncDef' (2) due to: Could not load file or assembly 'SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>
at (wrapper managed-to-native) System.RuntimeType:GetConstructors_native (System.RuntimeType,System.Reflection.BindingFlags)
at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) [0x00008] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00034] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00000] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Type.GetConstructor (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Xml.Serialization.TypeScope.GetConstructorFlags (System.Type type, System.Exception& exception) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.ImportTypeDesc (System.Type type, System.Reflection.MemberInfo memberInfo, System.Boolean directReference) [0x00444] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference, System.Boolean throwOnError) [0x00050] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type, System.Boolean directReference) [0x00017] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00014] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at Driver.Run (System.String[] args) [0x00110] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type of field 'SyncWebClientLight.ClientPackageController:_syncDef' (2) due to: Could not load file or assembly 'SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>
at (wrapper managed-to-native) System.RuntimeType:GetConstructors_native (System.RuntimeType,System.Reflection.BindingFlags)
at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) [0x00008] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00034] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00000] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Type.GetConstructor (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Xml.Serialization.TypeScope.GetConstructorFlags (System.Type type, System.Exception& exception) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.ImportTypeDesc (System.Type type, System.Reflection.MemberInfo memberInfo, System.Boolean directReference) [0x00444] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference, System.Boolean throwOnError) [0x00050] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type, System.Boolean directReference) [0x00017] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00014] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at Driver.Run (System.String[] args) [0x00110] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3366,5): error MSB6006: "sgen.exe" exited with code 1.
Done building target "GenerateSerializationAssemblies" in project "SyncWebClientLight.csproj" -- FAILED.
类型在那里:我可以深入到它在 VS4mac 中的引用,项目 SBW.Sync 编译正常,SyncWebClientLight 引用了正确的程序集。
如果我知道它从哪里加载程序集就好了(单声道中有 fuslogvw.exe 吗?)
因此,Mac 的 Visual Studio 似乎不理解 csproj/msbuild 标志:
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
而且 sgen 是让我无法继续工作的原因。所以让我们用我们自己的什么都不做的版本替换 sgen!
sgen 位于我的 Mac 上:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5
我在 VS4mac 中制作了一个什么都不做的简单 .NET 控制台应用程序,并将其复制到该目录,替换了原来的 sgen.exe
我现在可以编译我的程序集了,虽然担心我做了一些我可能不应该做的事情,但我的幸福感却略微受到了损害。
如果有人知道如何正确解决这个问题,我将不胜感激。
这是对您问题的部分回答,它提供了您的一般问题(提交到 App Store)的解决方案,但不是您在问题标题中提到的问题。
可以对 Windows 使用 Visual Studio 并创建要提交的包(并使用 Apple 的 Application Loader 来提交)。您需要将构建配置设置为 Ad-Hoc(不是 Debug 或 Release),将构建平台设置为 iPhone,设置您的证书并单击 Rebuild All,然后将在您的 [=20] 上生成 .ipa 文件=] 和 Mac,您可以使用它提交到商店。
在 Xamarin 网站上查看更多信息 https://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/app_distribution/app-store-distribution/publishing_to_the_app_store/
这帮助我弄清楚发生了什么。这是一个 msbuild 对比 xbuild 错误:
xbuild WebServicesNotWorking.sln /p:Configuration=Release (Works)
msbuild WebServicesNotWorking.sln /p:Configuration=Release (Your error).
分辨率:
- 使用 XS 代替 VSfM
- 取消选中 Preferences -> Projects -> Build -> Build with MSBuild instead of xbuild(我不推荐这样做,因为它可能会影响其他事情)
- 使用 xbuild 构建项目并检查输出。
在 Visual Studio(版本 7.0.1 build 24)中的 MacOS 上编译我们的应用程序时,出现错误:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB6006: "sgen.exe" exited with code 1. (MSB6006) (SyncWebClientLight)
如果我在 Visual Studio 2015 Pro 中开始构建(VS2015 连接到 Mac 并在那里编译),那么我可以调试等。这会很棒,除了我可以'从 VS2015 生成一个存档以提交到 App Store(无论出于何种原因,"Archive" 菜单选项显示为灰色)
有没有办法在 Visual Studio 中为 Mac 禁用 sgen.exe(某些 msbuild 开关或其他东西?)可能有帮助吗?
更新 1:
VS 2015 给出以下错误:
Could not load file or assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) SyncWebClientLight C:\projects\mWORKSPACE\trunk\Source\SyncWebClientLight\SGEN
所以这至少是多一点信息。
更新二:
Target GenerateSerializationAssemblies:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5/sgen.exe /assembly:/Users/mj/Documents/projects/mWORKSPACE/Source/SyncWebClientLight/obj/iPhoneSimulator/Release/SBW.SyncWebClientLight.dll /proxytypes /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/mscorlib.dll /reference:/Users/mj/Documents/projects/mWORKSPACE/Release/SBW.Sync.dll /reference:/Users/mj/Documents/projects/mWORKSPACE/Debug/SBW.SystemBase.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Core.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Data.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Web.Services.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/System.Xml.dll /reference:/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Xamarin.iOS.dll
Unhandled Exception:
System.TypeLoadException: Could not load type of field 'SyncWebClientLight.ClientPackageController:_syncDef' (2) due to: Could not load file or assembly 'SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>
at (wrapper managed-to-native) System.RuntimeType:GetConstructors_native (System.RuntimeType,System.Reflection.BindingFlags)
at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) [0x00008] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00034] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00000] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Type.GetConstructor (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Xml.Serialization.TypeScope.GetConstructorFlags (System.Type type, System.Exception& exception) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.ImportTypeDesc (System.Type type, System.Reflection.MemberInfo memberInfo, System.Boolean directReference) [0x00444] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference, System.Boolean throwOnError) [0x00050] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type, System.Boolean directReference) [0x00017] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00014] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at Driver.Run (System.String[] args) [0x00110] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type of field 'SyncWebClientLight.ClientPackageController:_syncDef' (2) due to: Could not load file or assembly 'SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:SBW.Sync, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:<none>
at (wrapper managed-to-native) System.RuntimeType:GetConstructors_native (System.RuntimeType,System.Reflection.BindingFlags)
at System.RuntimeType.GetConstructors_internal (System.Reflection.BindingFlags bindingAttr, System.RuntimeType reflectedType) [0x00008] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorCandidates (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.CallingConventions callConv, System.Type[] types, System.Boolean allowPrefixLookup) [0x00034] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.RuntimeType.GetConstructorImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00000] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Type.GetConstructor (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00032] in <ffb99659fc1c47faa4d5f883014d08aa>:0
at System.Xml.Serialization.TypeScope.GetConstructorFlags (System.Type type, System.Exception& exception) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.ImportTypeDesc (System.Type type, System.Reflection.MemberInfo memberInfo, System.Boolean directReference) [0x00444] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference, System.Boolean throwOnError) [0x00050] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.TypeScope.GetTypeDesc (System.Type type, System.Reflection.MemberInfo source, System.Boolean directReference) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type, System.Boolean directReference) [0x00017] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.ModelScope.GetTypeModel (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type, System.Xml.Serialization.XmlRootAttribute root, System.String defaultNamespace) [0x00014] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping (System.Type type) [0x00000] in <3a4ce9be61fd46ab845a4d68f2905e06>:0
at Driver.Run (System.String[] args) [0x00110] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(3366,5): error MSB6006: "sgen.exe" exited with code 1.
Done building target "GenerateSerializationAssemblies" in project "SyncWebClientLight.csproj" -- FAILED.
类型在那里:我可以深入到它在 VS4mac 中的引用,项目 SBW.Sync 编译正常,SyncWebClientLight 引用了正确的程序集。
如果我知道它从哪里加载程序集就好了(单声道中有 fuslogvw.exe 吗?)
因此,Mac 的 Visual Studio 似乎不理解 csproj/msbuild 标志:
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
而且 sgen 是让我无法继续工作的原因。所以让我们用我们自己的什么都不做的版本替换 sgen!
sgen 位于我的 Mac 上:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/4.5
我在 VS4mac 中制作了一个什么都不做的简单 .NET 控制台应用程序,并将其复制到该目录,替换了原来的 sgen.exe
我现在可以编译我的程序集了,虽然担心我做了一些我可能不应该做的事情,但我的幸福感却略微受到了损害。
如果有人知道如何正确解决这个问题,我将不胜感激。
这是对您问题的部分回答,它提供了您的一般问题(提交到 App Store)的解决方案,但不是您在问题标题中提到的问题。
可以对 Windows 使用 Visual Studio 并创建要提交的包(并使用 Apple 的 Application Loader 来提交)。您需要将构建配置设置为 Ad-Hoc(不是 Debug 或 Release),将构建平台设置为 iPhone,设置您的证书并单击 Rebuild All,然后将在您的 [=20] 上生成 .ipa 文件=] 和 Mac,您可以使用它提交到商店。
在 Xamarin 网站上查看更多信息 https://developer.xamarin.com/guides/ios/deployment,_testing,_and_metrics/app_distribution/app-store-distribution/publishing_to_the_app_store/
这帮助我弄清楚发生了什么。这是一个 msbuild 对比 xbuild 错误:
xbuild WebServicesNotWorking.sln /p:Configuration=Release (Works)
msbuild WebServicesNotWorking.sln /p:Configuration=Release (Your error).
分辨率:
- 使用 XS 代替 VSfM
- 取消选中 Preferences -> Projects -> Build -> Build with MSBuild instead of xbuild(我不推荐这样做,因为它可能会影响其他事情)
- 使用 xbuild 构建项目并检查输出。