首页 \ 问答 \ 从Powershell运行Visual Studio命令(Running Visual Studio commands from Powershell)

从Powershell运行Visual Studio命令(Running Visual Studio commands from Powershell)

我目前对PowerShell很新,我试图想出这个工具可以帮助我作为.net开发人员的各种方式。 很明显,powershell可以帮助我自动执行平凡的任务,这让我想到,例如,我可以使用PowerShell在发布模式下运行Visual Studio中的构建吗?

总之,我正在寻找一系列命令,允许我从powershell运行visual studio功能

谢谢,我希望这不是一个愚蠢的问题?!​​?


I am currently very new to powershell and am trying to think of various way this tool can help me as a .net developer. It seems clear that powershell can help me automate mundane tasks, which lead me to think, for example, can I use powershell to run a build in visual studio in release mode?

In summary, I am looking for a series of commands that allow me to run visual studio functionality from powershell

Thanks and I do hope this is not a stupid question?!?


原文:https://stackoverflow.com/questions/36374776
更新时间:2023-11-25 18:11

最满意答案

我刚刚面对同样的问题。 当您创建一个新的Web项目时,两个nuget包将自动添加到您的项目中。 如果你删除它们,你的问题应该解决。 软件包名称为:“ Microsoft.CodeDom.Providers.DotNetCompilerPlatform ”和“ Microsoft.Net.Compilers ”。


I've just faced the same problem. When you create a new web project, two nuget packages automatically added to your project. If you remove them, your problem should be solved. Package names are: "Microsoft.CodeDom.Providers.DotNetCompilerPlatform" and "Microsoft.Net.Compilers".

相关问答

更多
  • 所以,事实证明, CSharpCompilationOptions.Usings在编译脚本文件时只在编译器中检查过。 如果你追踪引用,它最终会在if (inScript)检查中在这里使用。 我们可能需要更好地记录。 So, it turns out that CSharpCompilationOptions.Usings is only ever examined in the compiler when compiling script files. If you trace through the re ...
  • 最大的区别在于,编译为安装的一部分的由NGEN中的Visual Studio安装的官方编译器。 然而,即使你是NGEN,你也不会得到完全相同的结果,因为微软有个人资料指导培训数据来支持部分NGEN,以便在二进制大小和JIT时间之间取得很好的平衡,这不是公共回购的一部分(类似于使用官方微软私钥进行签名)。 The biggest difference is that the official compiler installed by Visual Studio in NGEN compiled as par ...
  • 我刚刚面对同样的问题。 当您创建一个新的Web项目时,两个nuget包将自动添加到您的项目中。 如果你删除它们,你的问题应该解决。 软件包名称为:“ Microsoft.CodeDom.Providers.DotNetCompilerPlatform ”和“ Microsoft.Net.Compilers ”。 I've just faced the same problem. When you create a new web project, two nuget packages automatical ...
  • 更新:这个问题是2012年6月8日我博客的主题 。 感谢伟大的问题! 很好的问题 我们辩论了你长久以来提出的问题。 我们希望有一个具有以下特征的数据结构: 不可改变的。 树的形式。 从子节点访问父节点。 可能从树中的节点映射到文本中的字符偏移量。 坚持 通过持久性我的意思是当对文本缓冲区进行编辑时,可以重用树中大部分现有的节点 。 由于节点是不可变的,所以重用它们是没有障碍的。 我们需要这样的表现; 我们无法每次按键重新解析文件的巨大文件。 我们需要重新排序并重新解析仅受编辑影响的树的部分。 现在,当你尝试 ...
  • 从我可以收集的名字空间现在已经过时了。 如果有人感兴趣, SyntaxFactory替换Syntax 。 From what I can gather the namespaces are obsolete now. SyntaxFactory replaces Syntax if anyone is interested.
  • 是的,R#意味着与Roslyn兼容。 由于Roslyn还没有出现并且仍然在变化,因此可能存在一些错误,但这是可以理解的,并且将在未来的R#9更新中修复。 无论如何,我一直在与VS2015合作,没有任何问题。 Yes, R# is meant to be compatible with Roslyn. Since Roslyn isn't out yet and still changing, there could be some bugs but that's understandable and wou ...
  • 我通过注册编译操作来完成它,该编译操作只检查项目中的所有源树,查找它们引用的所有符号并考虑声明它们使用的程序集,因此项目引用的所有其他内容都未使用。 这是分析器: https : //github.com/HellBrick/HellBrick.Diagnostics/blob/master/src/HellBrick.Diagnostics/UnusedReferences/UnusedReferencesAnalyzer.cs 不确定这是否是最干净和正确的方法,但它似乎完成了工作。 I did it b ...
  • 您需要在IIS等Web服务器上托管此网站。 在“运行”窗口中键入inetmgr命令,打开计算机上的IIS管理器 IIS 7或更高版本:右键单击左侧的服务器节点 - >添加网站。 您需要将物理路径设置为发布此站点的位置,可能位于wwwroot文件夹中,因为此文件夹具有运行网站的所有权限。 IIS6:服务器节点 - >网站 - >新建 - >网站 在主机名中设置适当的标头,您就可以使用此主机标头访问该站点了。 每当您在visual studio 2008中构建网站时,都有一种自动发布方式,请遵循此答案 You ...
  • 不要那样做。 Roslyn有一个设计良好的公共API,应该能够做任何你需要的事情(除了在编辑层面)。 在这种特殊情况下,您应该使用DeclaringSyntaxReferences属性 。 通常,您可以使用http://source.roslyn.io/来跟踪内部属性的引用树并找到公共API。 Don't do that. Roslyn has a well-design public API which should be able to do anything you need (except at t ...
  • 在微软“Roslyn”2012年9月CTP的新内容中 ,注意到: 解析器支持完整的C#4和Visual Basic 10语言,但有几种语言功能尚未在当前的Roslyn编译器中完全实现。 .NET Framework 4.5(C#5.0和Visual Basic 11)中引入了调用者信息功能。 因此,Roslyn在当前版本中不支持它。 但是,获取调用者信息可以使用类似以下代码片段来完成:“ 我可以从Roslyn获取函数调用者/被调用者信息吗? ”在MSDN论坛中提出的问题: var syntaxTree = ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)