我正在尝试在我们打开visual studio时在默认的asp.net mvc应用程序中向注册页面添加一些额外的字段。我按照本教程。
这些是我打开Visual Studio for asp.net MVC中的默认项目后所遵循的步骤。
首先,我运行项目并单击“注册”按钮并注册了一个随机用户。我这样做是为了创建默认数据库。
这是所有这些更改后页面的显示方式。
现在我运行该项目并尝试注册一个人,但我一直收到此错误。
我研究了这个错误,但解决方案建议我应该尝试在myDBContext的构造函数中添加TypeError: Cannot read property 'config' of undefined
at meteorInstall.server.auth.js (server/auth.js:4:1)
at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1)
at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1)
at server/publications.js:124:1
at /home/ubuntu/workspace/musiker/.meteor/local/build/programs/server/boot.js:297:10
at Array.forEach (native)
at Function._.each._.forEach (/home/ubuntu/.meteor/packages/meteor- tool/.1.4.0.hylsrj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
at /home/ubuntu/workspace/musiker/.meteor/local/build/programs/server/boot.js:133:5
。但问题是,我根本没有任何背景。所以这个解决方案对我来说似乎不起作用。
答案 0 :(得分:4)
当您更改解决方案中的任何实体时,您应该更改数据库(因此您的对象模型等于您的数据库模型)。
在这种情况下,您应该打开nuget包控制台(service> nuget>控制台)并使用:
add-migration <YourNewMigrationName>
并且在创建新迁移(更改数据库模型的代码)之后,您必须接受它:
update-database
答案 1 :(得分:0)
只需删除添加到迁移表的记录