ASP.NET MVC4引导对象引用错误 [英] ASP.NET MVC4 Bootstrap Object Reference Error

查看:115
本文介绍了ASP.NET MVC4引导对象引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我启动了一个leran mvc结构项目.我想先添加一个登录面板.无论如何,问题出在哪里;我不想使用Bootstrap.
我搜索并使用了Package MAnager Console.

首先,我创建了一个空的ASP.NET MVC 4项目
其次,我使用了Package Manager Console并输入了内容;
安装软件包twitter.bootstrap.mvc4(成功完成)
安装软件包twitter.bootstrap.mvc4.sample(成功完成)
这些安装之后,我看到了readme.txt

当我运行项目时,我得到NullReferenceException:对象引用未设置为对象的实例.

Hello everyone,

I started a project to leran mvc structure. I want to add a login panel first. Whatever, the problem is; I wamt to use Bootstrap.
I searched and used Package MAnager Console.

First I created an empty ASP.NET MVC 4 project
Second I used Package Manager Console and typed;
install-package twitter.bootstrap.mvc4 (completed succesfully)
install-package twitter.bootstrap.mvc4.sample(completed succesfully)
After those installiation I have seen a readme.txt

When I run the project I am getting NullReferenceException: Object reference not set to an instance of an object.

public static object GetId(this object model)
   {
       return model.GetType().GetProperty(model.IdentifierPropertyName()).GetValue(model,new object[0]);
   }



我已经搜索过,但是找不到任何解决方案.你能帮我吗?

解决了以上问题.我们需要添加HomeController(默认控制器)和默认控制器的索引视图.

大问题;引导程序不起作用.就是说,没有stil或其他任何东西.



I have searched but couldn''t find any solution. Could you help me ?

Solved above problem. We need to add HomeController (default controller) and an Index View for the default controller.

The big problem; bootstrap does not work. Namely, there is no stil or any other thing. How could I activate bootstrap ?

推荐答案

我已经完成了您提到的相同步骤.但是没有运行时错误. 因此,请在新地方再次尝试新项目.祝您好运.

I have completed same steps which you have mentioned.But no run time errors.It''s working.
So try again with new project on new place.Good luck.

报价:

首先,我创建了一个空的ASP.NET MVC 4项目
其次,我使用了Package Manager Console并输入了内容;
安装软件包twitter.bootstrap.mvc4(成功完成)
安装软件包twitter.bootstrap.mvc4.sample(成功完成)
这些安装之后,我看到了readme.txt

First I created an empty ASP.NET MVC 4 project
Second I used Package Manager Console and typed;
install-package twitter.bootstrap.mvc4 (completed succesfully)
install-package twitter.bootstrap.mvc4.sample(completed succesfully)
After those installiation I have seen a readme.txt


这篇关于ASP.NET MVC4引导对象引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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