在debian/opensuse上的asp.net/xsp/mono上的TypeLoadException [英] TypeLoadException on asp.net/xsp/mono on debian/opensuse

查看:55
本文介绍了在debian/opensuse上的asp.net/xsp/mono上的TypeLoadException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我重置apache并加载我的网站时,出现以下第一个错误.我不知道是什么问题.如果我再次重新加载页面(不重新启动apache),则会收到第二个错误,可能是因为发生了第一个错误,而BaseUser是Application_Start使用的第一个类/函数.

When i reset apache and load my website i get the first error below. I have no idea what the problem is. If i reload the page again (without restarting apache) i get the 2nd error, probably because the first error occurred and BaseUser is the first class/func that Application_Start uses.

为什么会出现此加载异常?搞砸了的是,我尝试使用mono的VMWare img对其进行调试,并且得到了相同的异常(直到重新启动,现在它拒绝给我任何

Why am i getting this load exception? Whats messed up is i tried using mono's VMWare img to debug it and i got the very same exception (until i restarted which now refuses to give me anything but 404 errors). However when i use mono develop to run the project the site runs PERFECT. WTF.

有什么想法吗?

Server Error in '/' Application
A type load exception has occurred.

Description: HTTP 500. Error processing request.

Stack Trace:

System.TypeLoadException: A type load exception has occurred.
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 

Version information: Mono Runtime Version: 2.8.1 (tarball Mon Dec 27 10:20:03 UTC 2010); ASP.NET Version: 2.0.50727.1433

第二:

Server Error in '/' Application
Could not load type 'mynamespace.BaseUser' from assembly 'mynamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Description: HTTP 500. Error processing request.

Stack Trace:

System.TypeLoadException: Could not load type 'mynamespace.BaseUser' from assembly 'mynamespace, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  at mynamespace.Global.Application_Start (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod*,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 

Version information: Mono Runtime Version: 2.8.1 (tarball Mon Dec 27 10:20:03 UTC 2010); ASP.NET Version: 2.0.50727.1433

-edit-我要提到的是,我在opensuse和我的网站上都尝试了MonoDevelops网站的构建,而我遇到了完全相同的问题.

-edit- i'll mention that i tried MonoDevelops build of my site on both opensuse and my website and i get the exact same problem.

推荐答案

在Linux中,Mono有很多类似的问题,但是我设法解决了所有这些问题.

I had lots of similar problems with Mono in Linux, but I managed to handle all of them.

我不知道这是否适合您,但是在运行 xsp 之前,我会先做 xbuild .它帮助了我很多次,我什至都不知道为什么需要它,因为XSP应该像ASP.NET通常那样,在编译ASP.NET页面之前就先编译C#项目.

I don't know if this works for you, but I would do xbuild prior to running xsp. It helped me lots of times, and I don't even know why it was required, since XSP is supposed, like ASP.NET usually does, to precompile the C# project prior to compiling the ASP.NET pages.

TypeLoadException (通常,当程序集中不存在该类时也是如此,但这不是您的情况),因此我猜想是ASP.NET的Bin目录未填充应用程序的代码隐藏DLL.

TypeLoadException occurs when the assembly's DLL cannot be loaded (in general also when the class is not present in the assembly, but that's not your case), so I guess that the ASP.NET's Bin directory is not filled with the application's code-behind DLL.

但是...我也有一个疑问:由于调用了mynamespace.Global.Application_Start,这意味着您后面的代码已经被编译,否则您的错误将与有关全局类.

But... I also have a suspect: since mynamespace.Global.Application_Start is invoked, it means that your code behind has been compiled already, otherwise your error would be about the Global class.

尝试我的建议,然后告诉我会发生什么情况.

Try with my advice and tell me what happens.

这篇关于在debian/opensuse上的asp.net/xsp/mono上的TypeLoadException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆