Cant generate MyAssembly.XmlSerializer

50 Views Asked by At

In our Company Project, we have a method in a class with the following line

XmlSerializer serializer = new XmlSerializer(typeof(Settings)); This causes an exception saying that MyAssembly.XmlSerializer cant be found. From what I gather is that sgen.exe should build the .dll in question if I add

<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies> <SGenUseProxyTypes>false</SGenUseProxyTypes>

at the appropriate config section in my project file, but it doesn't. Instead, now I get an exception saying that I need to reference System.Config with the public key token "b03f5f7f11d50a3a", which I tried but it couldn't find it.

for reference: https://stackoverflow.com/a/8798289

I tried what was described in this answer but since ist from 2012, i suspect it isn't relevant or "correct" anymore for newer Frameworks since it doesn't work for me. Adding those lines causes an exception when trying to build the project. Our target Framework is 4.6. It's a WPF Application in C#

P.S. I have the same issue basically as the OP of the thread/answer I linked to. And sorry for lackluster formatting

0

There are 0 best solutions below