IIS7 Windows 7 64位
无论我做什么,我似乎都无法向网站添加应用程序.
当我'测试设置'时,我得到"无效的应用程序路径".
任何人都猜到我可能做错了什么?

我试图以编程方式执行msbuild并且无法执行以下命令:
string command = string.Format(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ""{0}\{1}.csproj""", _args.ProjectPath, _args.ProjectName);
Run Code Online (Sandbox Code Playgroud)
字符串呈现为:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "C:\...\TestResults\Foo 2011-08-31 16_29_40\Out\Foo\solutionName\projectName\projectName.csproj"
Run Code Online (Sandbox Code Playgroud)
然后我使用新的ProcessStartInfo(命令).问题似乎是Foo和2011之间的空间.我得到以下输出:
MSBUILD : error MSB1008: Only one project can be specified.
Switch: 16_29_40\Out\Foo\solutionName\projectName\projectName.csproj
Run Code Online (Sandbox Code Playgroud)
如何将项目文件传递给msbuild?
为了获得一些上下文,这个问题指的是How to save the IsExpanded state in group headers of a listview
我在这里缺少什么?
当我尝试按照参考帖子中的建议进行操作时,我得到:
BindingExpression 路径错误:在“对象”“ExpandStateManager”上找不到“[]”属性
我的展开状态管理器
public class ExpandStateManager
{
Dictionary<Category, bool> expandStates = new Dictionary<Category, bool>();
public bool this[Category key]
{
get
{
if (!expandStates.ContainsKey(key)) return false;
return expandStates[key];
}
set
{
expandStates[key] = value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
XAML
<ListView ItemsSource="{Binding Source={StaticResource cvs}}" ItemTemplate="{StaticResource animalTemplate}"
Width="200">
<ListView.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
<Expander IsExpanded="{Binding Source={StaticResource ExpandStateManger}, Path=[Items[0].ObjectType]}">
<Expander.Header>
<DockPanel>
<TextBlock Text="{Binding …Run Code Online (Sandbox Code Playgroud) 我无法弄清楚我在这里缺少什么.我想将ContentPresenter的内容绑定到UIElement.我正在做这样的事情:
<Window.Resources>
<DataTemplate x:Key="container">
<Border>
<!--<TextBlock Text="A"/>-->
<ContentPresenter Content="{Binding Element}" />
</Border>
</DataTemplate>
</Window.Resources>
<ContentControl DataContext="{Binding}" ContentTemplate="{StaticResource container}" />
Run Code Online (Sandbox Code Playgroud)
在MainWindow.cs中
UIElement Element { get; set; }
public MainWindow()
{
Element = new TextBox() { Text = "A" };
DataContext = this;
InitializeComponent();
}
Run Code Online (Sandbox Code Playgroud)
我可以直接放入textBlock,但是当我尝试使用ContentPresenter时它不会显示任何内容.