随笔分类 - Visual Studio
摘要:使用VS Code连接TFS时,提示以下错误: 临时解决方案是重命名你在VS Code配置"tfvc.location"下对应语言的目录,让VS Code找不到对应语言的资源包默认加载英语版本。比如我使用日语版本,我就把ja目录重命名为_ja。 如果想要修改VS Code的显示语言,可以输入Conf
阅读全文
摘要:使用Visual Studio 2013打开没有问题,但Visual Studio 2015打开cshtml就会提示"Object reference not set to an instance of an object"错误。解决方案是删除 %LocalAppData%\Microsoft\Vi
阅读全文
摘要:创建一个Android App项目后,直接启动调试发现Visual Studio Emulator for Android已成功运行,但应用始终处于Build中(等待时间超过1小时),并未如预期通过adb部署到模拟器中。将应用直接导出apk,拖拽至模拟器直接部署,提示:File transfer f...
阅读全文
摘要:选择C# > Android创建一个Blank App时提示如下错误:Value cannot be null. Parameter name: path1由于之前本机已安装过Android SDK,在安装Visual Studio 2015时跳过了,并没有为Xamarin指定对应路径导致。Visu...
阅读全文
摘要:NUnit的TestCaseAttribute可以简化大量的测试参数输入用例的编写,如果基于Visual Studio Unit Test Project开发则默认没有类似的功能,看一段对比代码:public class MyClass{ public Int32 DoWork(String ...
阅读全文
摘要:Visual Studio 2013安装完Update 3后启动立刻crash,异常信息为:System.InvalidOperationException was unhandledMessage: An unhandled exception of type 'System.InvalidOpe...
阅读全文
摘要:新建一个SQL Server Database Project,提示:Unable to open Database project This version of SQL Server Data Tools is not compatible with the database runtime components installed on this computer.老外说因为安装了Microsoft SQL Server 2012 SP1导致,而我并没有安装它且两个月前创建项目是成功的,最近唯一的变化就是安装了Visual Studio 2013 Preview、Visual Studi
阅读全文
摘要:打开项目文件,查找如下配置节定义:<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />确认是否符合XML规范,比如下面的错误定义:<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplicatio
阅读全文
摘要:Windows Store App类型项目打开任意xaml加载设计器视图提示:System.ExceptionPackage failed updates, dependency or conflict validation. (Exception from HRESULT: 0x80073CF3) at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath, String clientPort, Uri ..
阅读全文
摘要:安装Windows Phone 8 SDK,新建一个Windows Phone App,加载XAML设计器失败,同时智能提示无效。但新建一个WPF Application没有问题。设计器错误如下:System.UnauthorizedAccessExceptionAccess is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallCo
阅读全文
摘要:NuGet是一个开放性的组件发布、更新平台。它允许第三方自定义Package source,对于不同开发团队之间的组件版本获取将变的更为轻松。新建一个ASP.NET Empty Web Application,选中项目右键 -> Manage NuGet Packages,在Online -> NuGet official package source中搜索NuGet.Server:安装完成后,在IIS中默认浏览,站点会返回一个Package source的地址,比如:http://localhost:7004/nuget。打开Visual Studio -> 顶部菜单 -&
阅读全文
摘要:编写项目Build Events的Pre-build、Post-build时如果使用copy命令必须为绝对路径,比如预定义宏OutDir,编写如下命令:copy "$(SolutionDir)BuildLibrary" "$(OutDir)"得到exit code 1的提示,因为$(OutDir)返回相对路径,比如:“Bin\Debug\”。相对路径无法成功执行,只需要修改为如下命令:copy "$(SolutionDir)BuildLibrary" "$(TargetDir)"
阅读全文
摘要:基于TFS管理的解决方案打开时提示:“some of the properties associated with the solution could not be read”,并不影响项目加载,Output Window也没有多余提示。用记事本打开解决方案文件,查找“GlobalSection(TeamFoundationVersionControl)”,你会发现多处定义,只保留最顶部,删除重复定义。
阅读全文
摘要:为了和TFS更好集成,自动化编译、测试、发布。通常我会在Debug模式下使用NUnit、Release模式下基于Visual Studio Unit Testing。在Debug模式下定义一个条件编译符号:NUNIT,部分Attribute声明为兼容Visual Studio Unit Testing。比如:1 #if !NUNIT2 using Microsoft.VisualStudio.TestTools.UnitTesting;3 #else4 using NUnit.Framework;5 using TestClass = NUnit.Framework.TestFixtureAt
阅读全文
摘要:假设你的XAML上有一个控件它的属性和其它控件的某个属性相同名字,比如BorderBrush。现在我要将控件的属性BorderBrush名字改成其它名字,点击重构。你会发现所有XAML上名为BorderBrush的属性都比修改为新的名字,而不是只重构了被修改控件。
阅读全文
摘要:新安装了Windows SDK 7.1,在设置Microsoft Helper Viewer的location时选错了路径,于是选择卸载了Helper Viewer。安装运行WCU\Helper下的HelpSetup_x64(x86).exe,提示必须在安装完成Visual Studio 2010后才可以运行。MSDN Visual Studio Forms里有人提到需要重新再次安装、修复Visual Studio或者临时删除一个已经安装的功能就可以进入到安装Helper Viewer的界面。其实还有一个最快捷的方法就是首先启动Microsoft Help Library Agent(点击任何
阅读全文
摘要:1、选中项目、属性视图。2、Always Start When Debugging = false。
阅读全文