我是ASP.NET的新手,最近遇到了这个我在网上找不到的错误(也许是因为最近发布的MVC 6?)
System.InvalidOperationException The following errors occurred with attribute routing information:
Run Code Online (Sandbox Code Playgroud)
错误1:
具有相同名称'GetByIdRoute'的属性路由必须具有相同的模板:操作:'Appname.Web.Controllers.MemberController.GetById' - 模板:'api/Member/{id:int}'操作:'Appname.Web.Controllers .PaymentController.GetById' - 模板:'api/Payment/{id:int}'动作:'Appname.Web.Controllers.PlanController.GetById' - 模板:'api/Plan/{id:int}'
这为startup.cs提供了一个代码片段
Line 73:
Line 74: // Add MVC to the request pipeline.
Line 75: app.UseMvc(routes =>
Line 76: {
Line 77: routes.MapRoute(
Run Code Online (Sandbox Code Playgroud)
第75行突出显示
还有这个:
at Microsoft.AspNet.Mvc.ControllerActionDescriptorBuilder.Build(ApplicationModel application)
at Microsoft.AspNet.Mvc.Core.ControllerActionDescriptorProvider.GetDescriptors()
at Microsoft.AspNet.Mvc.Core.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
at Microsoft.AspNet.Mvc.Core.DefaultActionDescriptorsCollectionProvider.GetCollection()
at Microsoft.AspNet.Mvc.Core.DefaultActionDescriptorsCollectionProvider.get_ActionDescriptors()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute.GetInnerRoute()
at Microsoft.AspNet.Mvc.Routing.AttributeRoute..ctor(IRouter target, IActionDescriptorsCollectionProvider actionDescriptorsCollectionProvider, IInlineConstraintResolver constraintResolver, ILoggerFactory loggerFactory)
at Microsoft.AspNet.Mvc.Routing.AttributeRouting.CreateAttributeMegaRoute(IRouter target, IServiceProvider services)
at Microsoft.AspNet.Builder.BuilderExtensions.UseMvc(IApplicationBuilder app, Action<IRouteBuilder> configureRoutes)
at Appname.Web.Startup.Configure(IApplicationBuilder app, …Run Code Online (Sandbox Code Playgroud) 我知道我安装了所有软件包(pip冻结)我在Windows 10机器上运行python3.4并且遇到了奇怪的依赖问题
test.py:
from images2gif import writeGif
from PIL import Image, ImageSequence
import os
file_names = ['output\donkey-1.png', 'output\donkey-2.png']
images = [Image.open(fn) for fn in file_names]
size = (600,350)
for im in images:
im.thumbnail(size, Image.ANTIALIAS)
filename = "test.gif"
writeGif(filename, images, duration=0.5, subRectangles=False)
Run Code Online (Sandbox Code Playgroud)
运行test.py会出现以下错误,无法在Web上的任何其他位置找到此错误
Traceback (most recent call last):
File "test.py", line 2, in <module>
from images2gif import writeGif
File "C:\Python34\lib\site-packages\images2gif\__init__.py", line 1, in <module>
from images2gif import readGif as readGif
ImportError: cannot import name 'readGif'
Run Code Online (Sandbox Code Playgroud)