在执行出版例外:当一键发布具有相同键的项已被添加 [英] Upon one-click publish: Exception in executing publishing: An item with the same key has already been added

查看:1013
本文介绍了在执行出版例外:当一键发布具有相同键的项已被添加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认识到,一个十亿人都问过这个错误,但我看他们。矿似乎有所不同。我没有得到任何形式的来源$ C ​​$ C错误,不具有堆栈跟踪,没有任何有用的信息任何的,因为在点击我的MVC.NET项目发布立即发生的错误。这只是一个对话框,而这一切是算数的。没有什么事情发生。

I realize that a billion people have asked about this error, but I've looked at all of them. Mine seems different. I'm not getting any sort of source code error, no stack trace, no helpful information whatsoever, because the error occurs immediately upon clicking "Publish" on my MVC.NET project. It's just a dialog box, and that's all it says. Nothing else happens.

这可能是相关的东西:


  • 我使用的团队基础。我遇到了一些麻烦与它(用户错误)
    一会儿,但我只是把一切都回到了事情应该是这样
    (我认为)。

  • 在一个点上我用了一个EDMX的事情。我赞成从头开始做我的表款中删除。

  • 我找不到我的发布配置文件了,我也不能计算出如何使一个新的。我认为这应该是在〜/ PublishProfiles 文件夹中。它不存在。

  • I'm using Team Foundation. I had some trouble with it (user error) for a while, but I just got everything back to the way it should be (I think).
  • At one point I used an EDMX thing. I deleted in favor of making my table models from scratch.
  • I can't find my publishing profile anymore, nor can I figure out how to make a new one. I thought it was supposed to be in a ~/PublishProfiles folder. It's not there.

我知道我没有给予了很多的信息,但我甚至不知道从哪里开始。我会很乐意根据要求提供其他任何东西。谢谢你。

I know I haven't given a lot of information, but I don't even know where to begin. I'll be happy to provide anything else upon request. Thank you.

修改结果
我要指出,它建立和运行近似完美的本地主机服务器上。

EDIT
I should note that it builds and runs perfectly on the localhost server.

编辑2 结果
我回滚到源控制的最古老的版本,它的工作。我想我可以去刻意通过每个变更。 <击>另外,我确实发现了PublishProfiles文件夹。我核实,没有修改过的配置文件的。

推荐答案

我错了那里不是到发布配置文件的任何修改。这是发生了什么事。

I was wrong about there not being any changes to the publishing profile. Here is what happened.

我成立了一个名为,比如说一个code-第一实体的背景下, MyDBContext 。在我的发布配置文件 myprofile.pubxml ,有些code自动被插入这样的:

I set up a code-first Entities context called, say, MyDBContext. In my publishing profile myprofile.pubxml, Some code automatically gets inserted like this:

<PublishDatabaseSettings>
  <Objects xmlns="">
    <ObjectGroup Name="MyDBContext" ......
<MSDeployParameterValue Include="$(DeployParameterPrefix)MyDBContext-Web.config Connection String" />

然后,我决定尝试EDMX东西。但是,我保存,以防万一我的旧体制。现在,文件看起来是这样的:

Then, I decide to try the EDMX stuff. But I save my old structure just in case. Now the File looks like this:

<PublishDatabaseSettings>
  <Objects xmlns="">
    <ObjectGroup Name="MyDBContext" Order="1" ......
    <ObjectGroup Name="myEntities" Order="2" ......
<MSDeployParameterValue Include="$(DeployParameterPrefix)MyDBContext-Web.config Connection String" />
<MSDeployParameterValue Include="$(DeployParameterPrefix)myEntities-Web.config Connection String" />

但后来,我决定沟EDMX东西。但不知何故,而不是在.pubxml文件中删除第二组条目,这个事情发生了:

But then, I decide to ditch the EDMX stuff. Somehow, though, instead of removing the second set of entries in the .pubxml file, this happened:

<PublishDatabaseSettings>
  <Objects xmlns="">
    <ObjectGroup Name="MyDBContext" Order="1" ......
    <ObjectGroup Name="MyDBContext" Order="2" ......
<MSDeployParameterValue Include="$(DeployParameterPrefix)MyDBContext-Web.config Connection String" />
<MSDeployParameterValue Include="$(DeployParameterPrefix)MyDBContext-Web.config Connection String" />

瞧。第二组中删除,我好去。

Voila. Second set removed, and I'm good to go.

这篇关于在执行出版例外:当一键发布具有相同键的项已被添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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