我有一个项目(NRefactory - https://github.com/icsharpcode/NRefactory),但我无法构建解决方案.
这是我从VS得到的错误
Severity Code Description Project File Line Error The command "C:\Users\Kavignon_Developer\Documents\GitHub Projects\GitHub - Open Source Projects\SummerOfCode_2015\\.nuget\NuGet.exe restore -SolutionDirectory .." exited with code 9009. ICSharpCode.NRefactory6.CSharp C:\Users\Kavignon_Developer\Documents\GitHub Projects\GitHub - Open Source Projects\SummerOfCode_2015\ICSharpCode.NRefactory.CSharp\ICSharpCode.NRefactory6.CSharp.csproj 599
从一些帖子
我认为我的nuget有缺陷或缺失.在进入我的解决方案的nuget经理之后,nuget建议在我的解决方案中修复丢失的包.认为这是一个很好的选择所以我说是的.问题是,它没有改变这种情况.我重建并清理了解决方案,但没有产生任何影响.
有些人可能会告诉我,我没有nuget可执行文件,但如果没有它,我怎么能设法安装nuget包?另外,通过windows中的搜索功能,我能够找到nuget的.exe.
它应该在这里完成什么?我正在使用Visual Studio 2015 CTP 6.我没有选择,因为我正在使用VS中的新功能.
哪个是打开Url的首选方法(并且幕后有任何差异):
driver.Url = "http://example.com";
Run Code Online (Sandbox Code Playgroud)
要么
driver.Navigate().GoToUrl("http://example.com");
Run Code Online (Sandbox Code Playgroud)
此外,如果驱动程序已经指向同一页面,是否会再次设置Url会导致页面刷新?
即
...
driver.Url = "http://example.com";
driver.Url = "http://example.com"; //does this reload the page?
...
Run Code Online (Sandbox Code Playgroud)
FWIW我正在使用Chrome驱动程序chromedriver.exe,但它似乎不是一个托管程序集(我尝试用ILSpy打开它但没有运气).
我有一个需要相互通信的Windows服务和GUI.可以随时发送消息.
我期待在使用了NamedPipes,但似乎你不能阅读和在同一时间写入流(或至少我不能找到覆盖这种情况下,任何的例子).
是否可以通过一个NamedPipe进行这种双向通信?或者我需要打开两个管道(一个来自GUI->服务,一个来自service-> GUI)?
我正在研究谷歌测量协议,它为您提供了一种从服务器发送谷歌分析信息的方法.但是,似乎不需要任何身份验证.我错过了什么吗?否则,什么阻止其他人随意向我的帐户发送假数据?
我有一些核心ASP代码,我希望通过安全网页(使用表单身份验证)和通过Web服务(使用基本身份验证)公开.
我提出的解决方案似乎有效,但我在这里遗漏了什么吗?
首先,整个站点在HTTPS下运行.
站点设置为在web.config中使用表单身份验证
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" timeout="2880"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
然后我覆盖Global.asax中的AuthenticateRequest,以在Web服务页面上触发基本身份验证:
void Application_AuthenticateRequest(object sender, EventArgs e)
{
//check if requesting the web service - this is the only page
//that should accept Basic Authentication
HttpApplication app = (HttpApplication)sender;
if (app.Context.Request.Path.StartsWith("/Service/MyService.asmx"))
{
if (HttpContext.Current.User != null)
{
Logger.Debug("Web service requested by user " + HttpContext.Current.User.Identity.Name);
}
else
{
Logger.Debug("Null user - use basic auth");
HttpContext ctx = HttpContext.Current;
bool authenticated = false;
// look for authorization header …
Run Code Online (Sandbox Code Playgroud) 例如,我有一个触发事件的类,以及该事件的 1000 个订阅者。是否使用单个线程来逐个触发每个订阅者委托?或者 .Net 是否使用线程池并行处理部分或全部订阅?
我在我的网站上安装了通用分析,并希望解析__utmz
cookie以获取推荐信息.但是,我从未见过这个cookie集.
有什么变化?这个没有设置的原因是什么?
_ga
当我浏览我的网站时,我确实看到了cookie,__utmz
如果我去其他网站,我会在浏览器缓存中看到cookie .
我检查了文档,最近没有看到任何关于这种变化的提法,所以有点难过.
我有一个发送付款的简单应用程序.该应用程序在沙盒中工作正常.实时经典应用程序ID已被批准(显示为"自动批准"),但是当我输入我的实时凭据时,它会返回错误"您无权隐式执行此付款"
将XML发送到端点https://svcs.paypal.com/AdaptivePayments/Pay
:
我使用我的实时API密钥和真实帐户凭据发送它:
发送有效载荷:
<?xml version="1.0" encoding="UTF-8"?>
<PayRequest xmlns:ns2="http://svcs.paypal.com/types/ap">
<requestEnvelope>
<errorLanguage>en_US</errorLanguage>
<detailLevel>ReturnAll</detailLevel>
</requestEnvelope>
<clientDetails>
<applicationId>APP-5F976659LV9322736</applicationId>
<partnerName>MyName</partnerName>
</clientDetails>
<actionType>PAY</actionType>
<cancelUrl>https://mysite.com</cancelUrl>
<returnUrl>https://mysite.com</returnUrl>
<currencyCode>USD</currencyCode>
<feesPayer>EACHRECEIVER</feesPayer>
<memo>blah blah</memo>
<receiverList>
<receiver>
<amount>6.66</amount>
<email>personimpaying@gmail.com</email>
</receiver>
</receiverList>
<senderEmail>me@gmail.com</senderEmail>
<trackingId>f166b253-063e-4e24-9fd0-519ccddfffeb</trackingId>
</PayRequest>
Run Code Online (Sandbox Code Playgroud)
答复:
<?xml version='1.0' encoding='UTF-8'?>
<ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap">
<responseEnvelope>
<timestamp>2014-01-13T20:49:46.191-08:00</timestamp>
<ack>Failure</ack>
<correlationId>5924cfcacbf00</correlationId>
<build>7935900</build>
</responseEnvelope>
<error><errorId>550001</errorId>
<domain>PLATFORM</domain>
<subdomain>Application</subdomain>
<severity>Error</severity>
<category>Application</category>
<message>You do not have permission to execute …
Run Code Online (Sandbox Code Playgroud) 我有一个使用 EventLog 进行日志记录的 Windows 服务应用程序。在应用程序安装程序中我运行:
eventcreate /L APPLICATION /SO "My App" /T SUCCESS /id 1 /D "Initialised Log"
Run Code Online (Sandbox Code Playgroud)
然后在我的 C# 应用程序记录器中执行以下操作:
EventLog.WriteEntry(message, EventLogEntryType.Error, 1, 0, details);
Run Code Online (Sandbox Code Playgroud)
但是,当我查看应用程序事件日志时,除了我的事件之外,我还看到 EventID 0 的条目。我无法使用 eventcreate 创建 ID=0 条目(表示 ID 必须 >=1)。那么是什么造成了这些事件呢?有什么方法可以阻止事件日志抱怨安装损坏吗?
一个示例条目说:
该活动包含以下信息:
服务启动成功。
消息资源存在,但在字符串/消息表中找不到该消息
我正在寻找创建我称之为代理的东西,尽管这个定义可能有点不准确.
通常,你有这样的事情:
Client --------- Server
Run Code Online (Sandbox Code Playgroud)
我想要做的是引入代理,没有新的层,如下所示:
Client ----+---- Server
|
Proxy
Run Code Online (Sandbox Code Playgroud)
我不想要这个:
Client---Proxy---Server
Run Code Online (Sandbox Code Playgroud)
我知道WinPCap做了类似的事情,但据我所知,这是一个记录不完整的主题.
到目前为止,我已经尝试了一些事情,最值得注意的是在与客户端相同的端口上侦听消息.这导致了从随机应用程序接收到大量垃圾数据包(尽管在特定端口上侦听).我找不到很多建议我正在阅读正确的数据,虽然我相信我已经发现现在,经过一些小的修改.
有没有人知道反对使用这种方法的任何理由?或者有更可持续的方式吗?
如何在 SonarLint 中排除特定根包中的所有类?
例如,我想排除所有类,例如foo.bar.xxx
and foo.bar.yyy.zzz
。
我试过这两种方法都无济于事:
sonar.exclusions = /foo/bar/**
sonar.exclusions = **/foo/bar/**
我正在使用 Intellij 插件,但我认为语法将遵循此处的相同文档(https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus)
我试图想出一种通用的方法来拦截C#事件以进行处理(例如,记录,过滤,异步分发等),然后再将事件传递给其原始使用者.
所以举一个例子,在你正常的事物流中
class EventProducer
{
public event EventHandler<int> OnEvent;
internal void FireEvent()
{
if (OnEvent != null)
OnEvent(this, 1);
}
}
class EventConsumer
{
public EventConsumer(EventProducer producer)
{
producer.OnEvent += eventHandler;
}
public void eventHandler(object sender, int e)
{
Debug.WriteLine("Consumed " + e);
}
}
Run Code Online (Sandbox Code Playgroud)
就我而言,我想在两者之间插入一个额外的步骤......就像
//event consumer
class EventConsumer
{
//use this to handle one particular event (EventProducer.OnEvent)
InterceptEventHandler<int> EventHandler;
public EventConsumer(EventProducer producer)
{
//just one line of code to insert an event handler to do what I need …
Run Code Online (Sandbox Code Playgroud)