的Visual Studio 2012,发布(Web部署) - code首先迁移不改变的web.config [英] Visual Studio 2012, Publish (Web Deploy) - Code First Migrations not changing web.config

查看:155
本文介绍了的Visual Studio 2012,发布(Web部署) - code首先迁移不改变的web.config的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用从Visual Studio 2012发布工具的第一次 - 在本地作为测试

I am using the publish tool from Visual Studio 2012 for the first time - locally as a test.

我按照这个教程:
<一href=\"http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-to-production\" rel=\"nofollow\">http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-to-production

我可以发布站点文件很好,他们的工作。但是,code首先迁移似乎没有工作和放大器;没有创建数据库。即使我手动创建数据库,它不会改变(该测试是同一个SQL Server实例的主要场所是 - 只是舞台添加到名称的末尾)。

I can publish the site files fine, they work. But the code first migrations do not seem to work & no database is created. Even if I create the database manually, it doesn't change (for this test it is the same SQL Server instance that the main site is on - just with 'stage' added to the end of the name).

我也看不出有什么明显的企图在VS的输出窗口执行任何迁移 - 只是档案与文件夹创建。

I also see no apparent attempt to perform any migrations in the output window of VS - just file & folder creation.

我缺少的东西吗?

更新

根据这篇文章引用一些应该被添加到web配置,以使code目标服务器上的第一个迁移。他们没有被添加到本地配置 - 和目标服务器上的web.config中是不存在的(?我认为这是编译的部署,所以我不能看到它)

According to this article some references should be added to the web config to enable code first migrations on the target server. They aren't being added to the local config - and the web.config on the target server isn't there (I think it's compiled for deployment so I can't see it?).

它应该首先将其加入当地的web.config?这是什么问题?如果是这样,为什么不发布向导创建它,正是我需要输入?

Should it be adding this to the local web.config first? Is this the problem? If so why isn't the publish wizard creating it and exactly what would I need to enter?

<一个href=\"http://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=EN-US&k=k%28WebApplicationProjects.PackagePublishOverview%29;k%28TargetFrameworkMoniker-.NETFramework\" rel=\"nofollow\">http://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=EN-US&k=k%28WebApplicationProjects.PackagePublishOverview%29;k%28TargetFrameworkMoniker-.NETFramework

推荐答案

这个问题就走了,当我部署到Windows Server 2008服务器 - 而不是本地试验场

This problem went away when I deployed to a Windows Server 2008 server - rather than a local test site.

我确实有建立数据库并赋予权限到相应的IIS用户 - 但之后,它工作得很好。

I did have to create the database and give permission to the appropriate IIS user - but after that it worked fine.

这篇关于的Visual Studio 2012,发布(Web部署) - code首先迁移不改变的web.config的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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