哪些解析器可用于解析C#代码?
我正在寻找一个可以在C#中使用的C#解析器,让我可以访问有关所分析代码的每个人工制品的行和文件信息.
如何在Linq中执行LIKE查询?
我有以下查询我想执行.
var results = from c in db.costumers
where c.FullName LIKE "%"+FirstName+"%,"+LastName
select c;
Run Code Online (Sandbox Code Playgroud) 加载项和集成包之间的区别仍然不明确,现在使用Visual Studio 2010,扩展管理器与加载项管理器一起出现.
我正在尝试动态更改程序集绑定(从一个版本到另一个版本).
我试过这段代码,但它不起作用:
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSection assemblyBindingSection = config.Sections["assemblyBinding"];
assemblyBindingSection.SectionInformation.ConfigSource = "bindingConf.xml";
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("assemblyBinding");
Run Code Online (Sandbox Code Playgroud)
与bindingConf.xml含有assemblyBinding部配置.
那么可以在运行时更改此部分吗?怎么做?我有什么替代品?
最新的Resharper(v5)版本基于本机NUnit代码,允许使用NUnit插件.
我有一个NUnit插件,可以在NUnit GUI中正常工作,但我无法使用Resharper.基于R#指示我已经放入了我的插件库,%ResharperPath%\Bin\addins但是我没有工作,我的测试被标记为Ignored.
问题:如何在ReSharper中使用NUnit插件?
我正在使用Visual Studio 2010的"发布"功能的配置文件替换功能,如本文所述.我想使用MSBuild/Hudson自动执行此操作.有人知道怎么做这个吗?
我喜欢它是如何工作的,但如果我不能自动化它,我将不得不切换到XmlMassUpdate或类似的.
我需要在Eclipse插件的视图工具栏中添加一个下拉按钮.
实际上工具栏中的按钮添加如下:
<extension point="org.eclipse.ui.viewActions">
<viewContribution id="..." targetId="$MyViewId$">
<action id="..."
toolbarPath="action1"
class="Class extending Action and implementing IViewActionDelegate">
</action>
</viewContribution>
</extension>
Run Code Online (Sandbox Code Playgroud) 我一直在使用Tigris社区任务使用XMLUpdate任务更新各种AppSettings键.
现在,我想在system.net部分添加一个节点来设置代理.
我宣布了一处房产
<PropertyGroup>
<proxy><defaultProxy> <proxy usesystemdefault="False" proxyaddress="http://IPADDRESS:PORT" /> </defaultProxy></proxy>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
和XMLUpdate任务看起来像
<XmlUpdate
Prefix="n"
Namespace="http://schemas.microsoft.com/.NetConfiguration/v2.0"
XmlFileName="$(BuildDir)\Builds\_PublishedWebsites\Presentation\Web.config"
XPath="/n:configuration/n:system.net"
Value="$(proxy)" />
Run Code Online (Sandbox Code Playgroud)
这会更新Web配置,但它会直接从属性组更新,即不转换尖括号的转义字符.有没有人有任何想法?
我遇到了几个来源,说明使用包含文件(.wxi)将WiX安装文件拆分为单独的部分(变量,组件等).对我来说很有意义,所以我从.wxs文件中取出<components>节点并将它们放在一个单独的文件中,但是当我尝试在Visual Studio 2008中编译项目时,每个<ComponentRef>声明都会出错这是"产品:{...}"一节中的"未解决的符号参考...".
我已经使用<?包括"文件名"?>标记在我Product.wxs文件试过,但似乎打破了模式验证.如果是这样的,包括它的方式,在那里它需要去?
我有的文件如下.
Product.wxs
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product ...>
<Package .../>
<Media .../>
<Directory Id="TARGETDIR" Name="SourceDir">
</Directory>
<Feature Id="MainProgram" Level="1">
<ComponentRef Id="ProductComponent" />
<Feature Id="ContextMenu" Level="2">
<ComponentRef Id="ContextMenuComponent" />
</Feature>
</Feature>
</Product>
</Wix>
Run Code Online (Sandbox Code Playgroud)
Components.wxi
<?xml version="1.0" encoding="utf-8"?>
<Include>
<Fragment>
<Component Id="ProductComponent" ...>
<File .../>
</Component>
<Component Id="ContextMenuComponent" ...>
<RegistryKey .../>
</Component>
</Fragment>
</Include>
Run Code Online (Sandbox Code Playgroud)
如何在Visual Studio中构建它?编写脚本似乎更简单,但还不是我的问题.
Java中有没有办法从Font对象中获取本机字体名称?
我使用此代码获取我的字体,Font.decode("Serif")并且出于调试目的,我想知道使用的本机字体.
我有以下功能
public static List<DateTime> GetOnlyFridays(DateTime endDate, int weeks, bool isIncludeBaseDate)
{
//Get only the fridays from the date range
List<DateTime> dtlist = new List<DateTime>();
List<DateTime> tempDtlist = (from dtFridays in GetDates(endDate, weeks)
where dtFridays.DayOfWeek == DayOfWeek.Friday
select dtFridays).ToList();
if (isIncludeBaseDate)
{
dtlist = tempDtlist.Skip(1).ToList();
dtlist.Add(endDate);
}
else
{
dtlist = tempDtlist;
}
return dtlist;
}
Run Code Online (Sandbox Code Playgroud)
基本上我正在做的是使用GetDates函数获取日期列表,然后根据isIncludeBaseDate bool value(如果为真)跳过最后一个日期并添加Base Date
它工作正常,但这个程序可以改进吗?
我正在使用C#3.0和Framework 3.5
谢谢
c# ×3
msbuild ×2
.net ×1
c#-3.0 ×1
eclipse-pde ×1
eclipse-rcp ×1
fonts ×1
hudson ×1
java ×1
linq-to-sql ×1
nunit ×1
parsing ×1
resharper ×1
web-config ×1
wix ×1
xml ×1