Tag: visual studio 2012

即使使用’System.Collections.ObjectModel’也找不到’ObservableCollection’

包含System.Collections.ObjectModel 。 Visual Studio 2012仍然说Type or namespace name ‘ObservableCollection’ could not be found. 与此问题类似 码: class ObservableClass : ObservableCollection { } 编辑:这是.NET Framework 3.5,是一个控制台应用程序

在C#中使用microsoft访问和OleDb在数据库中添加数据

我是OleDb库的新手,我想用这个库将文本表单文本框添加到数据库中。 我的代码: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private OleDbConnection conn = new OleDbConnection(); private void button1_Click(object sender, EventArgs e) { conn.ConnectionString = @”Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Project\Learning\Visual C#\Form\WindowsFormsApplication1\WindowsFormsApplication1\Test.mdb”; string NAME = textBox1.Text; conn.Open(); OleDbCommand cmmd = new OleDbCommand(“INSERT into student(NAME)” + “VALUES(@NAME)”, conn); if (conn.State == ConnectionState.Open) { cmmd.Parameters.Add(“@NAME”, OleDbType.Char, 20); […]

Metro应用的倒数计时器

我是Metro Style Develop的初学者,我试图制作一个需要定时器的小游戏,倒计时从10到0.但是在这个Visual Studio中没有Timer Component,而DispatcherTimer没有映射到xmlns。 我试图使用TimeSpan,这个字段有“TicksPerSecond”但是这个例子不能帮助我制作我的倒数计时器: http : //msdn.microsoft.com/en-us/library/system.timespan.tickspersecond.aspx TimeSpan也有这个方法“FromSeconds”,我也不能将这个用于我的倒数计时器: http : //msdn.microsoft.com/en-us/library/system.timespan.fromseconds.aspx 另外我在stackoverflow上阅读了这个问题: 如何在Metro Style App中实现计时器,但这没用。 我能为这个倒数计时器做些什么?

Visual Studio将Web应用程序转换为网站

我知道这是倒退 – 但我想将Web应用程序转换回网站。 我想这样做是因为有很多人正在努力,我们希望能够只更新一个页面,而无需编译/部署整个项目。 我的环境是Visual Studio 2012 / ASP.Net 3.5 / c#

使用TFS 2012 API,如何获取用户的电子邮件地址?

我正在尝试使用API​​获取TFS 2012中特定用户的电子邮件地址。 我在“配置文件”部分设置了用户首选电子邮件地址。 我已经在网上进行了大量搜索并获得了以下代码。 var userId = “myUserId”; var collection = new TfsTeamProjectCollection(tfsUri, tfsCerd); var managementService = collection.GetService(); var member = managementService .ReadIdentity( IdentitySearchFactor.AccountName, userId, MembershipQuery.Direct, ReadIdentityOptions.ExtendedProperties); var emailAddress = member.GetAttribute(“Mail”, null) 这段代码既是成功又是失败。 它成功地检索了指定的用户; 但是,问题是Email属性为空。 当我分析成员变量时,我注意到那里列出了“Mail”属性并且它是空的。 然后我注意到还有另外两个名为“ConfirmedNotificationAddress”和“CustomNotificationAddress”的属性,它们在那里正确地使用了我喜欢的电子邮件地址。 我想知道为什么我似乎无法使用首选电子邮件地址正确加载“Mail”变量,因为我将需要此代码在许多人服务器上工作。

C#无法加载DLL(无法找到模块HRESULT:0x8007007E)

错误:无法加载DLL’x.dll’:找不到指定的模块。 (HRESULTexception:0x8007007E) 操作系统:Windows 7 我有两个站,Visual Studio 2012,使用.net 4.0; 另一个没有VS安装在VS2012的第一站我有一个C#解决方案,导入了C ++项目。 我正在使用: [DllImport(“x.dll”, CallingConvention = CallingConvention.Cdecl)] [return: MarshalAs(UnmanagedType.I4)] 在这个站上工作。 但是当我移动另一个站(没有安装VS)时,它出现了错误。 如果我安装VS,它正在工作。 出现此问题的可能原因是什么? 关于我可能缺少什么或如何调试此问题的任何想法?

如何缩短此通用列表?

我的问题很简单:如何进一步缩短此代码? List buttonList = new List(); buttonList.Add(button1); buttonList.Add(button2); buttonList.Add(button3); buttonList.Add(button4); buttonList.Add(button5); buttonList.Add(button6); buttonList.Add(button7); buttonList.Add(button8); buttonList.Add(button9);

对Visual Studio 2012 VSIX扩展进行数字签名

我正在尝试签署一个打包为VSIX文件的Visual Studio 2012 extension 。 我已按照http://www.jeff.wilcox.name/2010/03/vsixcodesigning/上的说明进行操作; 但是,我有兴趣在不指定pfx文件和密码的情况下执行签名。 例如,如果我要调用’signtool.exe’,我的命令行将是: “signtool.exe” sign /n MySubjectName /t ‘http://timestamp.verisign.com/scripts/timstamp.dll’ /d “MyDescription” MyPackage.vsix 我知道这个命令不适用于VSIX文件,尽管它适用于MSI存档。 使用此命令,调用signtool时无需指定密码或pfx文件。 使用指定的主题MySubjectName选择已安装的最佳证书。 按照Jeff博客上的代码,签名步骤要求定义pfx文件名和密码以创建签名中使用的X509Certificate2 : private static void SignAllParts(Package package, string pfx, string password, string timestamp){ var signatureManager = new PackageDigitalSignatureManager(package); signatureManager.CertificateOption = CertificateEmbeddingOption.InSignaturePart; /*…*/ signatureManager.Sign(toSign, new System.Security.Cryptography.X509Certificates.X509Certificate2(pfx, password)); } 是否有任何涉及PackageDigitalSignatureManager API可能让我找到基于MySubjectName的X509Certificate ,以便我可以签名?

如何从Visual Studio 2012中的resharper测试会话窗口导航到function文件?

对于验收测试,我在Visual Studio 2012中使用TeckTalk SpecFlow。当我运行所有specflow场景时,打开resharperunit testing会话窗口我可以看到所有测试结果。 就像下面的屏幕截图一样。 问题是,当我在某个function文件中看到测试失败(场景)时,如何从resharper会话窗口直接导航到此function文件进行编辑?

部署MVC4项目时出错:无法找到文件或程序集

过去,我只是使用Visual Studio 2012“发布到AWS”菜单项来部署我的MVC4网站(到AWS Elastic Beanstalk)。 现在,该程序在本地编译和运行,但无法部署。 从消息中,它似乎正在查找当前正在部署的项目中没有的文件,也不是当前项目的引用。 在某些尝试的部署中,错误是无法找到文件系统和项目中的文件。 VS似乎在错误的位置搜索和不需要的文件。 Commencing deployment for project MyWebApp.UI …building deployment package obj\Debug\Package\Archive… …package build ‘CopyPipelineFiles’: error in ‘C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets’ at (2567,5): Copying file Content\bootstrap-fam-fam\css\fam-icons.css to obj\Debug\Package\PackageTmp\Content\bootstrap-fam-fam\css\fam-icons.css failed. Could not find a part of the path ‘C:\MyWebApp\MyWebApp\MyWebApp.Model.Test\obj\Debug\Package\PackageTmp\Content\bootstrap-fam-fam\css\fam-icons.css’. …build of project archive failed, abandoning deployment Commencing deployment for project MyWebApp.UI […]