-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.XmlSerializer.Generator 2.0.0 - Could not load System.Runtime 4.2.1.0 #1390
Comments
Hello, I'm having the same SGEN1 warnings building a simple project in VS2019 16.3.1 that targets the netcoreapp2.1 framework and uses version 2.1.0 of the .NET Core Xml Serialization Generator:
The project only has a Class1 class with two string properties and a Program class with a Main method that creates an XmlSerializer for Class1. The .csproj file is as follows:
Interestingly, going back to the version 1.0.0 of the package makes the SGEN1 warnings disappear, but it still reports that the assembly does not contain any types that can be serialized using XmlSerializer, and the XmlSerializers assembly is not created. And going back to the netcoreapp2.0 framework, version 1.0.0 of the .NET Core Xml Serialization Generator works ok. Am I missing something? Is there something I can do to make it work? Thank you for your help. |
Hi, I tried the same steps as in the link and still I see the error as described here. Thanks for your help! |
Sorry for the delay in responding to this issue. We are attempting to reproduce the issues you have described to see if we can get an idea of what might be causing the problems you are seeing. |
I've tracked down the cause of the problem. The good news is there's a temporary workaround until we produce a fixed package. To work around it, you will need to modify the contents of the package. You will need to edit the file "%USERPROFILE%.nuget\packages\microsoft.xmlserializer.generator\2.1.0\lib\netstandard2.0\dotnet-Microsoft.XmlSerializer.Generator.runtimeconfig.json" to replace the tfm and version with the version of .NET Core that you are developing with. For example, if you are developing with .NET Core 2.1, your file would look like this: {
"runtimeOptions": {
"tfm": "netcoreapp2.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.1.0"
}
}
} If you aren't comfortable with using a modified version of the package, an alternative would be to separate out your data classes into a separate library project which targets netstandard2.0. We will update this issue when we have published a fixed nuget package. |
Hi Mat,
This resolved the issue. Thanks a lot for your help.
regards,
Balaji.P
…On Wed, Nov 27, 2019 at 4:10 AM Matt Connew ***@***.***> wrote:
I've tracked down the cause of the problem. The good news is there's a
temporary workaround until we produce a fixed package. To work around it,
you will need to modify the contents of the package. You will need to edit
the file
"%USERPROFILE%.nuget\packages\microsoft.xmlserializer.generator\2.1.0\lib\netstandard2.0\dotnet-Microsoft.XmlSerializer.Generator.runtimeconfig.json"
to replace the tfm and version with the version of .NET Core that you are
developing with. For example, if you are developing with .NET Core 2.1,
your file would look like this:
{
"runtimeOptions": {
"tfm": "netcoreapp2.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "2.1.0"
}
}
}
If you aren't comfortable with using a modified version of the package, an
alternative would be to separate out your data classes into a separate
library project which targets netstandard2.0.
We will update this issue when we have published a fixed nuget package.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/dotnet/corefx/issues/40730?email_source=notifications&email_token=AFUPAL5C5ZURWR6N62OW4XTQVWQU3A5CNFSM4ISTYNAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFHVTIA#issuecomment-558848416>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFUPAL7TM6NHMD5LLZDXM6DQVWQU3ANCNFSM4ISTYNAA>
.
|
Thank you Matt. I tried on a separate library project that targets netstandard2.1 and received the following error:
Do you have a temporary workaround for this case? Thanks for your help. |
@jasantosw See here for the support table: |
Hello folks! I'm getting the same problem here.
Any idea when that would be fixed? I mean, the workaround works on my machine but it would be a pain to do that on a CI machine... Thanks! |
Hi! I think it's a really important problem. I have waste many time on it. Please solve it soon. Thanks! |
I'm trying to connect to SQL Server Reporting Services to generate multiple PDF files (Invoices) without needing to display any UI - so just need the service connection to ReportExecution2005.asmx. I have code that works fine in a Net Framework WinForms project, but cannot get it to work with Net Core 3.1 in a WPF project. I've tried to use the method suggested at https://docs.microsoft.com/en-us/dotnet/core/additional-tools/xml-serializer-generator , but these instructions cannot be followed verbatim in a Net Core 3.1 WPF project (are there any specific instructions for such?). Despite trying ALL of the suggested solutions I can find, I cannot get to create an xmlserializers.dll at build (see Rebuild output lower down), and at runtime obviously get the exception below: ======== in 'reference.cs ' =========== 2>------ Rebuild All started: Project: ????????, Configuration: Release Any CPU ------ ========= Contents of 'ConnectedService.json' (and reference classes successfully generated when adding service connection to project) =========== |
@ericstj I've no problem trying to use SQL Reporting Services with NET Framework. All issues are with NET Core 3.1 and simply trying to use SQL Reporting Services and/or a ReportViewer in a WPF project under NET Core. There seem to be many issues with NET Core which mean that SQL Reporting Services cannot be used at present - seems a gaping hole in MS strategy. |
[EDIT] Investigation Completed.
Two additional issues have been identified from the investigation.
#597
#630
We will leave this issue open and update it as they get fixed.
See down below for a workaround.
Hi there!
I'm trying to generate an xml serialization assembly but I keep on stranding with the following:
I've seen several posts pointing to edit the configuration file of Visual Studio but that was no solution in my case.
I tried both version 1.0.0 and 2.0.0, neither of them work, however version 1.0.0 doesn't generate any specific log output. Both versions end their logging with similar lines;
Interestingly enough, though, is that I got no issue on another device. This proofs that it is a local issue. I'd still like to be able to use the generator on my main device, what am I missing that this does not work?
The text was updated successfully, but these errors were encountered: