2012-09-04 127 views
1

因为我没有发现有关我对谷歌的关注的信息,所以我会在这里尝试。将Visual Studio 2010 StartPage升级到2012?

在Visual Studio 2010上,可以创建Custom Start Pages。 我一年前做过一次,现在我已经习惯了。

那么,随着Visual Studio 2012发布,我无法再使用我的(VSIX)自定义开始页面。

在MSDN上,我发现这个:How to: Upgrade Visual Studio SDK/VSIX Projects to Visual Studio 2012,但是在我做完所有事情之后,它仍然无法工作。

的问题其实是,有没有“起始页项目模板”(要查找在扩展管理器)在Visual Studio 2010中

所以我发现这一点:How to: Manually Create a Start Page,但其完全地错误和复制/粘贴,因为它会导致Visual Studio 2010,但它会告诉Visual Studio 2012在顶部。

的教程后,我得到这个:

<Grid xmlns:sp="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.StartPage" 
     xmlns:vs="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0" 
     xmlns:vsfx="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.11.0" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     mc:Ignorable="d" 
     d:DesignHeight="300" d:DesignWidth="300"> 
<Grid> 
    <Label Content="My ListView:" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Foreground="White"/> 
    <ListView Width="Auto" Height="Auto" Margin="10,40,10,10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> 
     <ListView.View> 
      <GridView> 
       <GridViewColumn/> 
      </GridView> 
     </ListView.View> 
    </ListView> 
</Grid> 

这并不在VS2012工作,但在VS2010它就像一个魅力。

至少我没有选择,比自己尝试一下。 我使用的教程中我提供的最后一个环节(How to: Manually Create a Start Page)

起点:创建一个空白起始页和步骤5:在编辑器中,更改顶级用户控件元素网格元素而不删除任何命名空间声明

我没有这样做 - 我让它成为一个UserControl,然后我可以从Tools> Options> StartPage> Customize Start Page选择XAML,唯一的问题是现在,我不能CodeBehind,因为我不得不删除x:类(看看第6步)..

XAML中的内联代码不是一个选项,所以如果有人能帮助我,我如何将VSIX自定义起始页升级到VS2012,或者我如何创建具有Codebehind功能的工作空白起始页,或者如果我需要等到有人发布VS2012的起始页项目模板,我将非常感激。

回答

0

至少我没能解决我的问题..我从头开始,并与InlineCode创建那么一切(肯定与XAML和WPF)

0

这个带有Grid的xaml文件应该像真正的实现一样处理为'shell'。将网格的内容移动到单独程序集中定义的单独用户控件(可以使用后面的代码)。然后添加xmlns引用和这个新的控件到网格。

的XAML与电网进入到\ Documents \ Visual Studio 2010的\ StartPages \ 大会与您的用户控制权转至\ Common7 \ IDE \ PrivateAssemblies

+0

至少我能完成我的起始页,我使用了XAML-Only而没有Codebehind,所有代码都被写入到一个单独的库/ dll中,并且我正在xaml中引用它。 – eMi

相关问题