Questions tagged [sgen]

The Microsoft XML Serializer Generator Tool - creates xml serialiser assembly from an existing assembly.

The Microsoft XML Serializer Generator Tool - creates xml serialiser assembly from an existing assembly.

https://learn.microsoft.com/en-us/dotnet/standard/serialization/xml-serializer-generator-tool-sgen-exe

92 questions
1
vote
1 answer

Crazy .net / Sharepoint error involving random temp files not found

Logged into a customer environment today to check logs and just generally do an inspection, only to notice some tasks had failed in one application. Application is written in c# .net v4 running inside of IIS and exports to Sharepoint 2007. I can't…
JL.
  • 78,954
  • 126
  • 311
  • 459
1
vote
0 answers

Microsoft SGEN Tool Changes Tool Version In Comment Only

I came across some strange behavior with the SGEN tool that is used to generate classes from SGEN's. In the class files that are generated by the tool, there is a comment at the top of the file it says that the file was generated using version…
Craig Suchanec
  • 10,474
  • 3
  • 31
  • 39
1
vote
1 answer

Why does build fail in Release mode?

I have a C# MVC web app in VS2017 that references two library projects, Crd.Core and Crd.Data. These two libraries both reference the same third party dlls that I've got stored in a folder at the solution level. In Debug everything builds OK. In…
Phil Jones
  • 86
  • 5
1
vote
1 answer

CefSharp.Core.dll cannot be found during Release build

We have a .net 4.6.2 project that is distributed as "Prefer 32-bit" on AnyCPU, and is using CefSharp whose package has both x86 and x64 versions. Following the recommendation (Option 1) in the CefSharp project to add AnyCPU support I did the…
monty
  • 1,543
  • 14
  • 30
1
vote
1 answer

SGEN error about assembly with incorrect format on VSTS

I have a solution that has the following (simplified) structure: Application.sln |- Business.csproj |- DAL.vbproj Both projets target .NET Framework 4.5.2. It builds both locally and in VSTS. I have now added a NuGet package reference in the DAL…
Peter
  • 13,733
  • 11
  • 75
  • 122
1
vote
1 answer

Serialize() not using .XmlSerializers.dll produced with Sgen

I have a sgen step in my .NET 3.5 library, producing a correct XYZ.XmlSerializers.dll in the output directory. Still having poor serialization performance, I discovered that .NET was still invoking a csc at runtime. Using process monitor, I saw that…
mathieu
  • 2,330
  • 2
  • 24
  • 44
1
vote
2 answers

MSBuild failing due to sgen.exe error

I don't know where to start. My build fails in Release mode. Error message is: SGEN : error : Method 'ExecuteAuthorizationFilterAsync' in type 'Api.Attributes.ModuleAuthorizeAttribute' from assembly 'Api, Version=1.0.0.0, Culture=neutral,…
MotKohn
  • 3,485
  • 1
  • 24
  • 41
1
vote
1 answer

Visual studio doesn't let compile "Sgen could not be run"

Getting the error: "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" And…
Doctor Strange
  • 189
  • 1
  • 3
  • 12
1
vote
2 answers

XmlSerializer, sgen.exe and generics

I have a generic type: public class Packet where T : IContent { private int id; public int Id { get { return this.id; } } private T content; public T Content { get { return this.content; } } } I want to deserialize/serialize…
Romain Verdier
  • 12,833
  • 7
  • 57
  • 77
1
vote
2 answers

Build VS2010 solution using MSBuild 2008

Our dev team recently upgraded solution to VS2010 from VS2008 to use some of the features from VS2010 IDE. But our targeted framework is still .Net 3.5. When dev runs the MSBuild from VS 2008 command prompt to build VS2010 solution, build was…
1
vote
1 answer

TFS 2015 build SGEN error: 'assembly with incorrect format'

We are upgrading our TFS build system from 2012 to 2015, and are recreating our build machine. We setup the build service, installed necessary dependencies etc. The (legacy) XAML builds are working fine except for the following SGEN error: SGEN:…
davewilliams459
  • 1,679
  • 2
  • 15
  • 24
1
vote
0 answers

sgen doesn't serialize system.xml.dll

I'm working on a WCF service project. I need System.XML.XmlSerializers.dll, so I ran sgen on system.XML.dll on command-line, but I got this error: Error: Cannot deserialize type 'System.Xml.XmlWriterSettings' because it contains property…
1
vote
1 answer

Even using sgen on my service class still results in agonizingly slow constructor

So I'm trying to speed up our applications startup times -- and I've identified a major bottleneck to work on. Each of our webservice client classes takes forever and a day to instantiate. Some investigation revealed this is entirely due to the…
David Hay
  • 3,027
  • 2
  • 27
  • 29
1
vote
2 answers

SGEN : error : Mixed mode assembly

Can anyone help me im getting this error when im publishing my project on release mode SGEN : error : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration…
1
vote
0 answers

Speed Up Sgen.exe?

I am currently developing a code generation tool that takes an XML Schema and generates C# classes, compiles the C# classes and SGENs them with the sgen.exe to create the serializeable .dll. The problem is that generating the serializable dll from…
Jason Roell
  • 6,679
  • 4
  • 21
  • 28