You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
Ideally both of the following configurations should work…i.e a user should be able to call ‘ConfigureMvc’ either before or after AddMvc() and all the options registered would get called in the sequence they were registered.
Currently the issue is that #2 does not work as AddMvc() call doesn’t add options if it was added earlier.
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.ConfigureMvc(options =>
{
// This adds both Input and Output formatters based on DataContractSerializer
options.AddXmlDataContractSerializerFormatter();
// To add XmlSerializer based Input and Output formatters.
options.InputFormatters.Add(new XmlSerializerInputFormatter());
options.OutputFormatters.Add(new XmlSerializerOutputFormatter());
});
2. public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.ConfigureMvc(options =>
{
// This adds both Input and Output formatters based on DataContractSerializer
options.AddXmlDataContractSerializerFormatter();
// To add XmlSerializer based Input and Output formatters.
options.InputFormatters.Add(new XmlSerializerInputFormatter());
options.OutputFormatters.Add(new XmlSerializerOutputFormatter());
});
services.AddMvc();
The text was updated successfully, but these errors were encountered:
The change was merged into beta5 release and not in to beta6 dev. I discovered this as part of beta6 branching in which time the diff in the classes made it difficult to merge. This work item needs to be redone.
Ideally both of the following configurations should work…i.e a user should be able to call ‘ConfigureMvc’ either before or after AddMvc() and all the options registered would get called in the sequence they were registered.
Currently the issue is that #2 does not work as AddMvc() call doesn’t add options if it was added earlier.
{
services.AddMvc();
services.ConfigureMvc(options =>
{
// This adds both Input and Output formatters based on DataContractSerializer
options.AddXmlDataContractSerializerFormatter();
});
2. public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.ConfigureMvc(options =>
{
// This adds both Input and Output formatters based on DataContractSerializer
options.AddXmlDataContractSerializerFormatter();
});
services.AddMvc();
The text was updated successfully, but these errors were encountered: