为什么我不能在Visual Studio 2015年创建共享项目? [英] Why can't I create Shared Project in Visual Studio 2015?

查看:2092
本文介绍了为什么我不能在Visual Studio 2015年创建共享项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载的Visual Studio 2015年的社区我试图创建一个共享项目和我得到一个错误:

I downloaded visual studio community 2015. I tried to create a Shared Project and am getting an error:

这Microsoft.Windows.UI.Xaml.CSharp.targets

Content from Microsoft.Windows.UI.Xaml.CSharp.targets

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup Condition="'$(TargetPlatformVersion)'==''">
        <TargetPlatformVersion>8.0</TargetPlatformVersion>
    </PropertyGroup>

    <PropertyGroup Condition="'$(TargetPlatformIdentifier)' == 'UAP'">
        <RedirectionTarget>8.2</RedirectionTarget>
    </PropertyGroup>

    <PropertyGroup Condition="'$(RedirectionTarget)' == ''">
        <RedirectionTarget>$(TargetPlatformVersion)</RedirectionTarget>
    </PropertyGroup>

    <!-- Direct 8.0 projects to 8.1 targets to enable retargeting  -->
    <PropertyGroup Condition="'$(RedirectionTarget)' == '8.0'">
        <RedirectionTarget>8.1</RedirectionTarget>
    </PropertyGroup>

    <Import Project="$(RedirectionTarget)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>



我没有与名称8.1

I do not have folder with name 8.1

推荐答案

一个解决方法是进行以下修改:

One workaround is to make the following edits:

打开文件的%ProgramFiles(x86)的%\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing\Microsoft.CodeSharing.CSharp.targets (对于Visual Basic该文件是 Microsoft.CodeSharing .VisualBasic.targets ),并查找以下条目围绕8号线 -

Open the file %ProgramFiles(x86)%\MSBuild\Microsoft\VisualStudio\v14.0\CodeSharing\Microsoft.CodeSharing.CSharp.targets (for Visual Basic the file is Microsoft.CodeSharing.VisualBasic.targets) and look for the following entries around line 8 -

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')"/>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="!Exists('$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets')" />    



更​​改这些线以下 -

Change these lines to the following -

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" Condition="false"/>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" Condition="true" />



基本上,撤消的XAML 基于共享项目。

这是(信不信由你),我从MS接收到该问题的建议。我认为这是关系到RC的不洁升级(或更早)版本的RTM和不同的选择安装过程中选择。

This is (believe it or not) the advice I received from MS for this issue. I think it's related to an unclean upgrade of the RC (or earlier) versions to RTM and the selection of different options during install.

(将有关编辑不属于你,进行备份,而且如果你没有信心作出这样的修改文件通常告诫,不要)

(Insert usual caveats about editing files that don't "belong" to you, take backups, and if you're not confident to make such edits, don't)

这篇关于为什么我不能在Visual Studio 2015年创建共享项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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