Pergunta

Por que não Visual Studio 2005 gerando um ambiente de serialização quando eu definir a configuração "Gerar assembly de serialização" para "On" projeto?

Foi útil?

Solução

Acontece que Dev Studio só honra esta definição para Serviços Web.

Para os serviços não-web que você pode chegar a este trabalho adicionando um alvo AfterBuild ao seu arquivo de projeto:

  <Target Name="AfterBuild" DependsOnTargets="AssignTargetPaths;Compile;ResolveKeySource" Inputs="$(MSBuildAllProjects);@(IntermediateAssembly)"  Outputs="$(OutputPath)$(_SGenDllName)">         
      <SGen BuildAssemblyName="$(TargetFileName)" BuildAssemblyPath="$(OutputPath)"  References="@(ReferencePath)" ShouldGenerateSerializer="true" UseProxyTypes="false" KeyContainer="$(KeyContainerName)" KeyFile="$(KeyOriginatorFile)" DelaySign="$(DelaySign)" ToolPath="$(SGenToolPath)">
          <Output TaskParameter="SerializationAssembly" ItemName="SerializationAssembly" />
      </SGen>
  </Target>

Veja também:

Outras dicas

Pode ser feito manualmente com sgen.exe .

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top