从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
最满意答案
我刚刚面对同样的问题。 当您创建一个新的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 ...
-
发布没有roslyn的网站(Publish website without roslyn)[2023-11-15]
我刚刚面对同样的问题。 当您创建一个新的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 ... -
Roslyn语法节点是否重用?(Are Roslyn SyntaxNodes reused?)[2024-01-05]
更新:这个问题是2012年6月8日我博客的主题 。 感谢伟大的问题! 很好的问题 我们辩论了你长久以来提出的问题。 我们希望有一个具有以下特征的数据结构: 不可改变的。 树的形式。 从子节点访问父节点。 可能从树中的节点映射到文本中的字符偏移量。 坚持 通过持久性我的意思是当对文本缓冲区进行编辑时,可以重用树中大部分现有的节点 。 由于节点是不可变的,所以重用它们是没有障碍的。 我们需要这样的表现; 我们无法每次按键重新解析文件的巨大文件。 我们需要重新排序并重新解析仅受编辑影响的树的部分。 现在,当你尝试 ... -
Roslyn - 命名空间(Roslyn - namespaces)[2023-04-22]
从我可以收集的名字空间现在已经过时了。 如果有人感兴趣, 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 ...
-
如何发布网站(How to publish the Website)[2023-03-09]
您需要在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 = ...