首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Visual studio不允许编译"Sgen could be run“

Visual studio不允许编译"Sgen could be run“
EN

Stack Overflow用户
提问于 2017-11-01 03:16:15
回答 1查看 1.5K关注 0票数 1

获取错误:

代码语言:javascript
复制
"The specified task executable "sgen.exe" could not be run. The filename or extension is too long F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets   3408"

和警告:

代码语言:javascript
复制
"The command-line for the "SGen" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "SGen" into multiple calls with fewer parameters per call.   DAYAnalytics    F:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets 3408"

在Microsoft.Common.CurrentVersion.targets的这一部分:

代码语言:javascript
复制
<SGen
    BuildAssemblyName="$(TargetFileName)"
    BuildAssemblyPath="$(IntermediateOutputPath)"
    References="@(ReferencePath)"
    ShouldGenerateSerializer="$(SGenShouldGenerateSerializer)"
    UseProxyTypes="$(SGenUseProxyTypes)"
    UseKeep="$(SGenUseKeep)"
    KeyContainer="$(KeyContainerName)"
    KeyFile="$(KeyOriginatorFile)"
    DelaySign="$(DelaySign)"
    ToolPath="$(SGenToolPath)"
    SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
    EnvironmentVariables="$(SGenEnvironment)"
    MSBuildArchitecture="$(SGenMSBuildArchitecture)"
    SerializationAssembly="$(IntermediateOutputPath)$(_SGenDllName)"
    Platform="$(SGenPlatformTarget)"
    Types="$(SGenSerializationTypes)">

解释很简单,但我不知道如何修复它。如何缩短命令行长度?

EN

回答 1

Stack Overflow用户

发布于 2017-11-13 21:22:45

将构建选项中的"Generate serialization assembly“选项设置为"Auto”或"Off",除非您需要它们(即广泛使用XmlSerializer),在这种情况下,您可以在以下位置找到更多信息:Generating an Xml Serialization assembly as part of my build

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47043024

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档