我想将我的应用程序转移到同一网络中的其他生产服务器 我使用vs 2010(Debug Mod)发布我的网站,我将它复制到一个服务器,我得到一个例外 另一台服务器加载它很好 我已经在两台服务器上创建了iisreset并删除了.net临时文件,但仍有一个给了我一个例外而另一个没有。
这是我在一台服务器上获得的异常: 我相信我得到了错误的堆栈,因为它是部署环境。
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at ExpressApp.Models.ActionsMetadata.BaseField.GetWrapper() in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\BaseField.cs:line 42
at ExpressApp.Models.ActionsMetadata.Renderers.Field..ctor(FieldName name, List`1 validators, ApplicationLanguage lang) in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\Renderers\Field.cs:line 21
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at ExpressApp.Models.ActionsMetadata.ActionStep.LoadFields(XDocument stepFields, ApplicationLanguage lang) in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\ActionStep.cs:line 67
at ExpressApp.Models.ActionsMetadata.ActionStep..ctor(String name, XDocument stepFields, ApplicationLanguage lang, Type handler, App App, Boolean secured) in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\ActionStep.cs:line 22
at ExpressApp.Models.ActionsMetadata.AppAction.ChargeSteps(XDocument xAction) in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\AppAction.cs:line 107
at ExpressApp.Models.ActionsMetadata.AppAction..ctor(App App, XDocument xAction, String actionName, ApplicationLanguage lang) in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\AppAction.cs:line 84
at ExpressApp.Models.ActionsMetadata.AppActions.Load() in C:\Users\myPC\Documents\Visual Studio 2010\Projects\ExpressApp\ExpressApp\Models\ActionsMetadata\AppAction.cs:line 58
修改
第42行没有任何可能发生的事情
我甚至做过
try{}catch(Exeption e){log.Error(e)}
在整个方法中有防止异常,但我仍然得到异常