Comments (7)
A quick update on this issue. It appears that referencing only Microsoft.AspNetCore.Mvc.Core should be fine. Updating the references with in project.json model can be a pain. Due to transitive dependencies, a few things had to change for test projects. I'm looking forward to converting back to *.csproj when VS2017 is released as soon as I have time.
I've got a few items queued up. I'll include this change and it should go out in the 1.1.0 release. I'm hoping to have that done within the next week (maybe lesss).
from aspnet-api-versioning.
I cloned the repository and took a stab at this. The only changes were project.json from the main .Net Core project:
"Microsoft.AspNetCore.Mvc": "1.0.0" => "Microsoft.AspNetCore.Mvc.Core": "1.0.0"
And the two unit test projects had some
IApplicationBuilder.AddMvc() => IApplicationBuilder.AddMvcCore()
class [TestController] : Controller => class [TestController] : ControllerBase
Everything compiled, but 34 tests of tests started failed because of getting NotAcceptable (406 I think) status codes back from the server instead of whatever code the test was expecting. I don't understand why at the moment.
from aspnet-api-versioning.
At this point, I've seen two results:
Take the following test:
_a_query_string_versioned_Controller_per_namespace._get_should_return_200
At one point, I saw that it returned 4 possible actions to select with the error message (notice all 4 are exactly the same):
Multiple actions matched. The following actions matched route data and had all constraints satisfied:
Microsoft.AspNetCore.Mvc.ByNamespace.Controllers.V1.AgreementsController.Get (Microsoft.AspNetCore.Mvc.Acceptance.Tests)
Microsoft.AspNetCore.Mvc.ByNamespace.Controllers.V1.AgreementsController.Get (Microsoft.AspNetCore.Mvc.Acceptance.Tests)
Microsoft.AspNetCore.Mvc.ByNamespace.Controllers.V1.AgreementsController.Get (Microsoft.AspNetCore.Mvc.Acceptance.Tests)
Microsoft.AspNetCore.Mvc.ByNamespace.Controllers.V1.AgreementsController.Get (Microsoft.AspNetCore.Mvc.Acceptance.Tests)
For now, I might leave that as a debugging oddity. The second result I've seen is perhaps what should have worked. See the class:
Microsoft.AspNetCore.Mvc.Versioning.ApiVersionActionSelector.SelectBestCandidate
The branch else if ( finalMatches.Count == 1 )
is hit and a single action descriptor is returned. After that, ReportApiVersionsAttribute
does its thing, then the debugger reports I'm in external code, and suddenly the test fails with HTTP 406, Not Acceptable.
This is a head scratcher for me because by all means the code appeared to succeed.
from aspnet-api-versioning.
I'm definitely in support of the fewest number of dependencies. I'm trying to remember the details, but I seem to remember there was some reason why *.Mvc was needed over *.MvcCore. It's possible that things have changed in 1.1 from 1.0. It's definitely worth investigating.
Do you have the latest changes? There were a couple of flakey tests that took me a long time to figure out why. Ultimately, it was a mistake and bug on my part. That has since been resolved. The latest codebase should run the tests reliably for any changes you make.
I'll look at dropping the dependencies down a level in the next release. There's no sense in claiming the library needs more than it does.
from aspnet-api-versioning.
I'll try latest code again when I get settled back in after the holiday break and then report back.
from aspnet-api-versioning.
I'm fairly novice to Git style source control... but I just did a fork of the Master branch to https://github.com/AdamDotNet/aspnet-api-versioning (note that I didn't check in my changes to my fork yet)
I then reapplied the changes to MvcCore.
The same result of the 34 unit tests failing still occurs.
from aspnet-api-versioning.
One thing I forgot to mention is I didn't have the exact same .Net Core SDK installed, so global.json was changed to
"sdk": { "version": "1.0.0-preview2-003131" }
This is just a slightly newer version of the .Net Core 1.0.0 SDK.
from aspnet-api-versioning.
Related Issues (20)
- only the 5.1.0 version of Microsoft.AspNetCore.Mvc.Versioning is deprecated HOT 3
- Problem with describing reponse codes in minimal api HOT 3
- Cannot run APIs with different controller names with same ControllerName attribute after migration HOT 6
- Different options in `ApiVersioningOptions.cs` between .NET Framework and .NET Core packages HOT 2
- WithOpenApi() ignore Api versioning readers HOT 4
- .net 8 support HOT 7
- Breaking changes when migrating to OData8 + new versioning HOT 10
- odata/$metadata returns 404 when all controllers are decorated with ApiVersionNeutralAttribute HOT 3
- AddVersionedApiExplorer not working in Asp.Versioning HOT 5
- VersionedApiDescriptionProvider does not set the correct SunsetPolicy to ApiDescription instances HOT 1
- Using ApiExplorerSettingsAttribute together with ApiVersionAttribute produces unexpected number of ApiVersionDescriptions HOT 5
- Asp.Net Core WebApi - AWS ECS Cluster Authentication failure HOT 2
- [Versioned Clients][API Notifications] Fails to read new versions when available HOT 2
- Swashbuckle documentation inconsistent with examples HOT 2
- AssumeDefaultVersionWhenUnspecified does not work correctly if ApiVersionNeutral is used in the controller HOT 2
- swagger.json file not found after update HOT 9
- My API is not displaying all the versions. HOT 4
- Improve docs for HeaderApiVersionReader
- Add synonym to `AddMvc` method. HOT 7
- CurrentImplementationApiVersionSelector behaves differently based on whether an operation still exists on latest API version HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnet-api-versioning.