Tag: visual studio 2012

已经通过’ListView’注册的属性

我有这个代码: using System.Collections; using System.Windows; using System.Windows.Controls; public static class SelectedItems { private static readonly DependencyProperty SelectedItemsBehaviorProperty = DependencyProperty.RegisterAttached( “SelectedItemsBehavior”, typeof(SelectedItemsBehavior), typeof(ListView), null); public static readonly DependencyProperty ItemsProperty = DependencyProperty.RegisterAttached( “Items”, typeof(IList), typeof(SelectedItems), new PropertyMetadata(null, ItemsPropertyChanged)); public static void SetItems(ListView listView, IList list) { listView.SetValue(ItemsProperty, list); } public static IList GetItems(ListView listView) { return listView.GetValue(ItemsProperty) […]

Visual Studio将类的所有属性转储到编辑器中

好的,这里有一个为视觉工作室提供了许多方便的小插件的人,或者可以帮助按键序列。 假设我有一个Person类: class Person { string Name { get; set; } int Age { get; set; } } 而且我正忙着快​​乐地编码。 我经常会遇到需要为该类的所有属性赋值的情况,或者将属性的所有值分配给其他属性。 public override void CopyTo(Person myPerson) { myPerson.Name = “XXX”; myPerson.Age = 11; } 我想生成这个部分: myPerson.Name myPerson.Age 即只需将myPerson的所有属性转储到一个小列表中。 在Visual Studio编辑器中。 我安装了resharper,我快速浏览了一个专门做这个的实用程序,但我找不到一个。 有人可以帮忙吗?

ClickOnce Manifest包含无效子项 – 但xml与旧发布的清单匹配

在我的应用上安装更新或全新安装ClickOnce发布时出错。 这种情况发生在未安装应用程序的计算机上以及已安装应用程序的计算机上。 我用于签署项目的pfx文件与以前的版本相同,所以我认为证书不是问题。 + Exception reading manifest from .exe.manifest: the manifest may not be valid or the file could not be opened. + The element ‘assembly’ in namespace ‘urn:schemas-microsoft-com:asm.v1’ has invalid child element ‘SignedInfo’ in namespace ‘http://www.w3.org/2000/09/xmldsig#’. List of possible elements expected: ‘dependency’ in namespace ‘urn:schemas-microsoft-com:asm.v1’ as well as ‘dependency’ in namespace ‘urn:schemas-microsoft-com:asm.v2’ as well […]

EF6和EF4.1在文件层次结构中的区别

我是Entity Framework的初学者。 我注意到当我EF6 with Visual studio 2013使用EF6 with Visual studio 2013 : 我有.Designer.cs空文件与此评论: // T4 code generation is enabled for model ‘C:\Users\Luka\Desktop\Test\EF-db2008\AdventureWorks\AdventureWorksLib\AdventureWorksLib\AWLTModel.edmx’. // To enable legacy code generation, change the value of the ‘Code Generation Strategy’ designer // property to ‘Legacy ObjectContext’. This property is available in the Properties Window when the model // is […]

淡入/淡出Windowsapp store应用程序中的TextBlock

有人可以解释一下,当我在Windowsapp store应用中加载表单时,如何为文本块添加淡入和淡出动画? 我尝试了WPF方法,但它没有用…谢谢:)

如何将visual studio 2010 SP1解决方案转换为visual studio 2012解决方案?

我知道他们(大多数项目类型)在2010 SP1和2012之间是相互兼容的,并且没有必要进行转换,但如果我还需要它呢? 如果我需要将我的解决方案标记为Visual Studio 2012解决方案,该怎么办? 当双击VS2010解决方案时,版本选择器会自动使用VS2010打开它(即使我现在安装了VS2012),图标上也有一个数字10(而不是数字11)。 怎么做??。

VS / NuGet如何决定创建csproj引用,这些差异意味着什么?

当我安装NuGet包时,它通常使用新引用更新我的proj文件,如下所示: False ..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll 这有两个部分,有时不添加: , Version=4.5.0.0… 和 False 每个设置有什么含义?NuGet如何选择在安装/更新包时指定哪个组合?

为什么这个代码不能用VS 4.0在VS2010中编译?

以下代码不能在VS2010中编译,但在VS2012中编译而不做任何更改。 VS2010中有问题的一行是 names.Select(foo.GetName) 错误CS1928:’string []’不包含’Select’的定义和最佳扩展方法重载’System.Linq.Enumerable.Select (System.Collections.Generic.IEnumerable ,System。 Func )’有一些无效的参数。 using System; using System.Linq; namespace ConsoleApplication1 { class Program { static void Main() { var foo = new Foo(); var names = new[] {“Hello”}; Console.WriteLine(string.Join(“, “, names.Select(foo.GetName))); } } public class Foo { } static class Extensions { public static string GetName(this Foo foo, string name) […]

错误:两个输出文件名解析为相同的输出路径:“obj \ Debug \ Project1.Form1.resources”

我收到了错误: Two output file names resolved to the same output path: “obj\Debug\Project1.Form1.resources” 尝试运行我创建的Windows窗体应用程序时出现此错误。 一些搜索显示,这是由于两个.resx文件的出现而发生的。 我的应用程序中有两个.resx文件。 我的申请表中还有两种表格。 我通过复制第一个表单并重命名和修改副本来创建第二个表单。 两个.resx文件是form1.resx和form2.resx。 如何删除此错误?

无法添加对“Microsoft Windows Installer对象库”的引用

我无法在VS2012中添加对“Microsoft Windows Installer对象库”的引用。 任何想法,什么可能导致这个问题? 当我尝试创建COM组件的引用时,我收到此错误消息“无法添加对’Microsoft Windows Installer对象库’的引用”。 VS项目是基本类库(c#x86)。