API Deployed in Web Hosting

Jul 22, 2014 at 4:56 PM
Edited Jul 22, 2014 at 10:29 PM
just wondering if you have best practices on how to deploy this in webhosting, im using cloudsite in Rackspace.

Also how you you keep the stream alive in mvc website project. thanks!

just an update, when deployed, im getting this error, but working nice and smooth locally. can you point me what going on here? thanks again
 Method 'AddWebException' in type 'Tweetinvi.Logic.Exceptions.ExceptionHandler' from assembly 'Tweetinvi.Logic, Version=0.9.3.3, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.TypeLoadException: Method 'AddWebException' in type 'Tweetinvi.Logic.Exceptions.ExceptionHandler' from assembly 'Tweetinvi.Logic, Version=0.9.3.3, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[TypeLoadException: Method 'AddWebException' in type 'Tweetinvi.Logic.Exceptions.ExceptionHandler' from assembly 'Tweetinvi.Logic, Version=0.9.3.3, Culture=neutral, PublicKeyToken=null' does not have an implementation.]
   Tweetinvi.Logic.TweetinviLogicModule.InitializeExceptionHandler() +0
   Tweetinvi.Logic.TweetinviLogicModule.Initialize() +650
   Tweetinvi.Injectinvi.AutofacContainer.InitializeModules() +121
   Tweetinvi.Injectinvi.AutofacContainer.Initialize() +113
   Tweetinvi.Injectinvi.AutofacContainer..ctor() +39
   Tweetinvi.TweetinviContainer..cctor() +40

[TypeInitializationException: The type initializer for 'Tweetinvi.TweetinviContainer' threw an exception.]
   Tweetinvi.TweetinviContainer.Resolve() +0
   Tweetinvi.TwitterCredentials..cctor() +29

[TypeInitializationException: The type initializer for 'Tweetinvi.TwitterCredentials' threw an exception.]
   Tweetinvi.TwitterCredentials.CreateCredentials(String userAccessToken, String userAccessSecret, String consumerKey, String consumerSecret) +0
   Balitaan.Scraper.Handlers.TweetHandler.Run() in TweetHandler.cs:26
   TweetPOC.Controllers.TweetController.Run() in TweetController.cs:18
   lambda_method(Closure , ControllerBase , Object[] ) +62
   System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
   System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +188
   System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
   System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +59
   System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +240
   System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +12
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +31
   System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +23
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +128
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +26
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +41
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +28
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +25
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +30
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9048061
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
Coordinator
Jul 24, 2014 at 10:16 AM
Edited Jul 24, 2014 at 10:20 AM
Hello there,

Well, I have to say that this error is very very confusing. The error simply state that the ExceptionHandler (which implements IExceptionHandler) does not implement it.
I am not sure how this is possible but the problem probably comes from the .NET Framework installed on the machine. The generated IL code might have gone wrong for some reason.

I will have a look tonight when I do have some time, but please read the following question on stackoverflow.

Here are some questions :
  • Have you compiled the project on your own?
  • Could you please try with the latest release (0.9.3.4)?
Will come back to you.
Linvi
Jul 24, 2014 at 12:55 PM
Edited Jul 24, 2014 at 12:56 PM
Hi Linvi,

I used NuGet to get the tweetinvi package. Also Rackspace Cloud Site is running under medium trust, might be the problem but i cant confirm. thanks

is it possible that the hosting IP address was blocked in twitter api giving such result?
Coordinator
Jul 24, 2014 at 1:03 PM
Edited Jul 24, 2014 at 1:05 PM
Could you please try doing an Update-Package TweetinviAPI in the Package Manager Console.

is it possible that the hosting IP address was blocked in twitter api giving such result?
It is possible but this is not the problem you are facing right now.

Linvi
Jul 24, 2014 at 1:14 PM
I think I have the latest update as I'm getting "No updates available for 'TweetinviAPI' in project" message from console. thanks!
Coordinator
Jul 25, 2014 at 12:57 AM
Hi there, I did not actually had enough time to investigate and find a solution to this problem.
I will keep you up to date tomorrow.

Linvi
Dec 19, 2014 at 1:49 AM
Hi Linvi,

I am having the exact same issue using 0.9.3.3: works fine locally but target production environment is not happy. Was this fixed in 0.9.3.4 or have you figured out what the cause of this issue was?
Jun 3, 2015 at 4:31 PM
Hello Linvi,
Did you find a solution for this problem please
Best Regards,
Coordinator
Jun 29, 2015 at 1:09 AM
Hi everyone,

Please try using the following nuget package and let me know if this fixes your issue.

**Install-Package TweetinviAPI -Version 0.9.8.1-forNET40 -Pre **

Cheers,
Linvi