最近,在我一直在研究的一些解决方案中,配置管理器对话框显示“配置”和“平台”的空白字段,并且始终未选中“构建”。更改值并保存配置并不能解决问题。
并非所有解决方案都会发生这种情况(例如,在创建新解决方案时,不会出现此问题)。为什么会发生这种情况,我该如何解决?
屏幕截图(审查项目名称):
最近,在我一直在研究的一些解决方案中,配置管理器对话框显示“配置”和“平台”的空白字段,并且始终未选中“构建”。更改值并保存配置并不能解决问题。
并非所有解决方案都会发生这种情况(例如,在创建新解决方案时,不会出现此问题)。为什么会发生这种情况,我该如何解决?
屏幕截图(审查项目名称):
I have experienced the same problem (adding an Oracle Database project to my solution).
To fix the problem you should edit the solution file (.sln). Find the Oracle Database project (search for oradbproj). You should find something like this:
Project("{218574D1-FF94-4B95-8577-A6D58C11C315}") = "MyOracleDatabase",
"MyOracleDatabase\MyOracleDatabase.oradbproj", "{41823BBF-36F6-42AC-9C41-119241BAAFEC}"
EndProject
Later, in the same .sln file search for the begining of the section "GlobalSection(ProjectConfigurationPlatforms) = postSolution". There would be many entries like these:
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Release|Any CPU.Build.0 = Release|Any CPU
Copy them an replace the GUID with the second one in the previos "oradbproj" line ({41823BBF-36F6-42AC-9C41-119241BAAFEC} in the previous example):
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE85B8BD-1BCF-468C-AA0B-B869B87A66D5}.Release|Any CPU.Build.0 = Release|Any CPU
{41823BBF-36F6-42AC-9C41-119241BAAFEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41823BBF-36F6-42AC-9C41-119241BAAFEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41823BBF-36F6-42AC-9C41-119241BAAFEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41823BBF-36F6-42AC-9C41-119241BAAFEC}.Release|Any CPU.Build.0 = Release|Any CPU
Now you can save the .sln file. If you edited the .sln file from outside the Visual Studio having it opened, coming back to Visual Studio it would prompt to reload the solution. Click Yes and wait. That is!!!
在深入研究它比我想承认的时间更长之后,我发现罪魁祸首是一个 Oracle 数据库项目 (.oradbproj)。显然,当它被添加到解决方案时,Visual Studio 并没有在解决方案配置和数据库项目的项目配置之间创建映射。手动添加映射似乎可以解决问题。我从另一个项目(在解决方案文件的 ProjectConfigurationPlatforms 部分)复制了映射,然后将 GUID 替换为与数据库项目对应的 GUID。进行更改、保存并重新打开解决方案后,一切看起来都很好!