Excelentes notícias, galera! Os templates iniciais do MVC 5 e do WebAPI
2 rodaram sem nenhuma alteração, do Visual Studio 2013 para o Mono no
Linux!
Basicamente o teste que eu fiz aqui foi: criar duas soluções, uma com o
template do MVC 5 e uma com o template do WebAPI 2; copiar as soluções
do Windows e recompilar/testar no MonoDevelop do Debian.
O que eu precisei fazer:
- Atualizar o repositório oficial do Mono para Debian (instruções nesse
link:
http://www.mono-project.com/docs/getting-started/install/linux/ ),
nem precisei compilar, o repositório oficial já disponibiliza o release
mais recente.
- Adicionar pastas que o
ASP.NET pede e que eu nunca entendi o propósito
delas: Digite "sudo mkdir -p /etc/mono/registry/LocalMachine" no
terminal
- Obviamente ter instalado os pacotes mono-complete e monodevelop para
poder testar com precisão
Mas nem tudo são flores, em contrapartida eu fiz um teste com o Nancy
via OWIN (que deveria ser mais fácil de rodar do que o próprio MVC 5), e
justo ele me apresentou problemas. Segue abaixo a mensagem de erro:
System.MissingMethodException: Method
'HttpRequestBase.GetBufferlessInputStream' not found.
at Microsoft.Owin.Host.SystemWeb.CallStreams.InputStream.get_Stream ()
<0x4110b4f0 + 0x0000f> in <filename unknown>:0
at
Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.get_CanRead
() <0x4110b4c0 + 0x00013> in <filename unknown>:0
at Nancy.IO.RequestStream.ThrowExceptionIfCtorParametersWereInvalid
(System.IO.Stream stream, Int64 expectedLength, Int64 thresholdLength)
<0x40ed9d70 + 0x00024> in <filename unknown>:0
at Nancy.IO.RequestStream..ctor (System.IO.Stream stream, Int64
expectedLength, Int64 thresholdLength, Boolean disableStreamSwitching)
<0x41036c80 + 0x00103> in <filename unknown>:0
at Nancy.IO.RequestStream..ctor (System.IO.Stream stream, Int64
expectedLength, Boolean disableStreamSwitching) <0x4110b470 + 0x0003f>
in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Nancy.IO.RequestStream:.ctor
(System.IO.Stream,long,bool)
at Nancy.Owin.NancyMiddleware+<>c__DisplayClass4
+<>c__DisplayClass6.<UseNancy>b__1 (IDictionary`2 environment)
<0x41102c80 + 0x002d7> in <filename unknown>:0
at
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage+<RunApp>d__5.MoveNext () <0x41102890 + 0x00083> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown
---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
<0x4110f460 + 0x00033> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess
(System.Threading.Tasks.Task task) <0x4110ef80 + 0x00113> in <filename
unknown>:0
at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x4110edb0 + 0x000b3> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd
(System.Threading.Tasks.Task task) <0x4110ed50 + 0x00042> in <filename
unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult ()
<0x4110ed20 + 0x0001a> in <filename unknown>:0
at
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext+<DoFinalWork>d__2.MoveNext () <0x4110e8f0 + 0x0021b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown
---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
<0x4110f460 + 0x00033> in <filename unknown>:0
at Microsoft.Owin.Host.SystemWeb.Infrastructure.ErrorState.Rethrow ()
<0x4110fac0 + 0x00021> in <filename unknown>:0
at
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End
(IAsyncResult ar) <0x4110cd30 + 0x0006b> in <filename unknown>:0
at
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork (IAsyncResult ar) <0x4110fa20 + 0x0001f> in <filename unknown>:0
at System.Web.AsyncInvoker.<doAsyncCallback>m__0 (System.Object ores)
<0x4110f8a0 + 0x000c3> in <filename unknown>:0
Talvez tenha sido algum vacilo meu, mas se o MVC 5 rodou, então é no
mínimo estranho ter problemas com um framework que sempre rodou tão bem
no modo self-host suprindo algumas necessidades minhas.
> +
unsub...@googlegroups.com.
> --
> Você recebeu essa mensagem porque está inscrito no grupo "MonoBrasil"
> Para postar nesse grupo, envie um e-mail para
>
monob...@googlegroups.com.
> Acesse esse grupo em
http://groups.google.com/group/monobrasil.
> Para mais opções, acesse
https://groups.google.com/d/optout.