简体   繁体   English

在Visual Studio Community 2015 RC中发布编译VSIX项目的问题

[英]Issue compiling VSIX project in Visual Studio Community 2015 RC

I am attempting to create a Visual Studio VSIX extension, and I'm running into an issue when compiling with 3 "Dependencies" that are C# class libraries in the same solution: 我试图创建Visual Studio VSIX扩展,并且在使用3个“ Dependencies”(它们是同一解决方案中的C#类库)进行编译时遇到问题:

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project. 错误MSB4057:项目中不存在目标“ VSIXContainerProjectOutputGroup”。

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project. 错误MSB4057:项目中不存在目标“ VSIXContainerProjectOutputGroup”。

error MSB4057: The target "VSIXContainerProjectOutputGroup" does not exist in the project. 错误MSB4057:项目中不存在目标“ VSIXContainerProjectOutputGroup”。

All three assemblies are set to "Embed in this VSIX" and the embed folder is set to "/"; 所有三个程序集均设置为“在此VSIX中嵌入”,并且embed文件夹设置为“ /”; here is the XML in the "source.extension.vsixmanifest" file: 这是“ source.extension.vsixmanifest”文件中的XML:

<Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.6" d:InstallSource="Download" />
    <Dependency d:Source="Project" d:ProjectName="Networking" d:InstallSource="Embed" Version="0.5" Location="|Networking;VSIXContainerProjectOutputGroup|" DisplayName="|Networking;VSIXNameProjectOutputGroup|" Id="|Networking;VSIXIdentifierProjectOutputGroup|" d:VsixSubPath="/" />
    <Dependency d:Source="Project" d:ProjectName="Utilities" d:InstallSource="Embed" Location="|Utilities;VSIXContainerProjectOutputGroup|" DisplayName="|Utilities;VSIXNameProjectOutputGroup|" Id="|Utilities;VSIXIdentifierProjectOutputGroup|" d:VsixSubPath="/" />
    <Dependency d:Source="Project" d:ProjectName="Data Model" Version="1.0" d:InstallSource="Embed" d:VsixSubPath="/" Location="|Data Model;VSIXContainerProjectOutputGroup|" DisplayName="|Data Model;VSIXNameProjectOutputGroup|" Id="|Data Model;VSIXIdentifierProjectOutputGroup|" />
  </Dependencies>

This code needs to be in separate assemblies so that it can be referenced by other projects. 该代码需要放在单独的程序集中,以便其他项目可以引用。

I already tried both suggestions mentioned in this MSDN forum question, and neither worked. 我已经尝试过 MSDN论坛问题中提到的两个建议,但都没有起作用。

There is another less troublesome but possibly relevant problem that is happening: every once in a while, the classes and namespaces in these three projects seem to disappear, and I have to remove and re-add the references to them. 还有另一个不太麻烦但可能相关的问题正在发生:每隔一段时间,这三个项目中的类和名称空间似乎消失了,我必须删除并重新添加对它们的引用。

Any help fixing these problems would be greatly appreciated; 解决这些问题的任何帮助将不胜感激; please let me know if I can provide any other information to help solve them. 请让我知道是否可以提供其他信息来帮助解决它们。

EDIT 编辑

I tried recompiling in Release mode to see if it was a configuration-specific problem, but nothing changed. 我尝试在发布模式下重新编译,以查看是否是特定于配置的问题,但没有任何更改。

I managed to fix it by removing the lines that specify OutputGroupsIncludedInVSIX and OutputGroupsIncludedInVSIXLocal for the project references in the csproj file of the extension project, and changing the libraries to be "Assets" instead of "Dependencies" in the vsixmanifest file. 我设法通过在扩展项目的csproj文件中删除为项目引用指定OutputGroupsIncludedInVSIXOutputGroupsIncludedInVSIXLocal的行,并在vsixmanifest文件中将库更改为“ Assets”而不是“ Dependencies”,从而解决了该问题。

Hopefully this helps other people with the same issue. 希望这对其他遇到相同问题的人有所帮助。

If any of the dependencies are multi target .NET core framework libraries (ie netstandard2.0;net462 ) in VS2017 and you get this error: 如果任何依赖项是netstandard2.0;net462中的多目标.NET核心框架库(即netstandard2.0;net462 ),则会出现此错误:

Error: c:\\path\\to\\depproj.csproj : error MSB4057: The target "BuiltProjectOutputGroupDependencies" does not exist in the project 错误:c:\\ path \\ to \\ depproj.csproj:错误MSB4057:项目中不存在目标“ BuiltProjectOutputGroupDependencies”

Add this: 添加:

<AdditionalProperties>TargetFramework=net462</AdditionalProperties>

To the .csproj file in the project reference node as an additional property. 作为项目参考节点中的.csproj文件的附加属性。

<ProjectReference Include="..\path\to\deprpoj.csproj">
    <Project>{81eab942-30aa-445e-86d6-ad6becdf804c}</Project>
       <Name>Your.Project.Name</Name>   
    <AdditionalProperties>TargetFramework=net462</AdditionalProperties>
</ProjectReference>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM