我昨天在MSDN上发布时下载了Visual Studio 2012.我注意到我们2010年的一些项目类型已经消失或不同.我现在最大的不同是删除了Windows Installer项目.现在我们被迫使用InstallShield LE(限量版).这里的问题是我写了大量的Windows服务,我看不到如何设置InstallShield LE.我们(我的公司)似乎必须投资专业版的许可证.
有没有人找到在InstallShield LE中安装服务的方法?使用Windows Installer项目时,只需设置自定义操作即可.
我目前遇到了单选按钮和分组的问题.我在转发器控件中有一个asp单选按钮.我将组名属性设置为"客户".页面加载时,单选按钮不会分组.它不是将id字段设置为组名,而是设置单选按钮的值字段.我知道我已经尝试在转发器控件之外设置单选按钮并且遇到了同样的问题.这里发生了什么?
ASPX
<asp:Repeater ID="repCustomers" runat="server">
<HeaderTemplate>
<table class="tableDefault" cellpadding="0" cellspacing="0" border="0" style="width: 383px; border: 0px !important">
<tr>
<th> </th>
<th>Cust. No.</th>
<th>Cust. Name</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:RadioButton ID="radCustomer" GroupName="Customer" runat="server" ValidationGroup="Customer" ToolTip='<%#Eval("CustomerNumber") %>' />
</td>
<td><%#Eval("CustomerNumber")%></td>
<td><%#Eval("Name") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Run Code Online (Sandbox Code Playgroud)
输出html
<table class="tableDefault" cellpadding="0" cellspacing="0" border="0" style="width: 383px; border: 0px !important">
<tr>
<th> </th>
<th>Cust. No.</th>
<th>Cust. Name</th>
</tr>
<tr>
<td>
<span title="111111"><input id="ctl00_PrimaryContent_repCustomers_ctl01_radCustomer" type="radio" name="ctl00$PrimaryContent$repCustomers$ctl01$Customer" value="radCustomer" /></span>
</td>
<td>111111</td>
<td>Jeremy's Test</td>
</tr>
<tr>
<td>
<span …Run Code Online (Sandbox Code Playgroud) 我有一个在我的系统上工作正常的项目.我可以毫无问题地调试项目.我的开发系统是Win 7(x64).当我将此项目部署和/或发布到我的测试环境(Windows Server 2003(x32))时,我无法再对其进行调试.我一直收到一条错误,指出"以下模块是在启用优化或没有调试信息的情况下构建的." 它指的是我的项目中的一个DLL来自解决方案中的另一个项目.
此应用程序最初是在VS 2005中创建的.我将其升级到VS 2010没有任何问题.我还认为原始项目需要重新考虑,因此我将所有业务和数据层逻辑拉出来并将其放入解决方案中的单独类库项目中.Web项目也需要拆分,因为相同的代码在两个不同的服务器上运行,两个服务器上都有不同的页面.但是,两个Web项目之间存在共享表示逻辑,因此我创建了另一个专门用于表示层的类库项目.毕竟,我现在有4个项目(2个类库项目和2个Web项目).
所有网页都正常工作,但似乎我在其中一个Web项目中遇到了一些Web服务(经典Web服务,而不是WCF)的问题.我得到了错误的结果,我试图通过它来找到问题.请帮忙!我有一个关于这个项目的截止日期.
我有一个大型Web API项目,运行我公司的电子商务网站.我只是注意到,对Web API的任何请求都会在IIS日志中将URI-stem显示为root.有没有办法查看被调用的API端点的完整路径?
我想在我们的弹性搜索/日志存储/ Kibana(ELK)设置中使用File Beats.我们今天有File Beat设置来监视IIS日志,只是显示root并没有向我们提供我们在日志记录中寻找的信息.
我有一个客户试图从我们的 Web 应用程序访问他们的日历。一切都适用于我们所有的其他客户,所以我不确定这里有什么不同,除了这个客户在澳大利亚并且使用非 gmail.com 电子邮件地址。
客户能够授权我们的应用程序,我们确实为用户获得了一个 oauth 令牌。我们请求访问日历并且客户授予了它。当我们请求所有日历的列表时,我们会收到无效的授权消息。
下面是我们用来访问他们日历的代码。被调用的方法是 GetAllWritableCalendars。
public class GoogleCalendarAdapter : ICalendarAdapter {
#region attributes
private readonly ISiteAuthTokenQueryRepository _tokenRepo;
private readonly GoogleCalendarSettings _settings;
private const string APPNAME = "SomeAppName";
private const string ACL_OWNER = "owner";
private const string ACL_WRITER = "writer";
#endregion
#region ctor
public GoogleCalendarAdapter(ISiteAuthTokenQueryRepository tokenRepo,
GoogleCalendarSettings settings) {
_tokenRepo = tokenRepo;
_settings = settings;
}
#endregion
#region methods
private GoogleAuthorizationCodeFlow BuildAuthorizationCodeFlow() {
return new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer() {
ClientSecrets = BuildClientSecrets(),
Scopes = BuildScopeList()
});
} …Run Code Online (Sandbox Code Playgroud) 我最近发现了 TopShelf。从我读过的所有内容来看,它看起来非常酷。唯一的问题是我一直无法使用它。我一定错过了什么。下面是我的代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Topshelf;
namespace TestTopShelf {
public class FooBar {
public FooBar() {
}
public void Start() { }
public void Stop() { }
}
public class Program {
public static void Main() {
HostFactory.Run(x => {
x.Service<FooBar>( s => {
});
});
}
}
}
Run Code Online (Sandbox Code Playgroud)
你可以看到它有点不完整。当我尝试为 ConstructUsing、WhenStarted 和 WhenStopped 设置“s”对象的属性时,Visual Studio 未推断出正确的类型。我是 lambda 表达式的新手,甚至是 TopShelf 的新手,所以我不确定我在做什么。
我在 TopShelf 文档中使用这个页面来让我开始。它看起来很简单,所以我不确定我错过了什么。
更新代码
using Autofac;
using System;
using System.Collections.Generic; …Run Code Online (Sandbox Code Playgroud) 在我的开发环境中,我有一个用户,我刚刚收到了以下范围的 OAuth 令牌。
一切看起来都很好,我为用户存储了令牌。然后我请求列出用户的日历,我得到了无效请求的无效请求。我使用另一个用户的令牌(也在我的开发环境中)尝试相同的请求,并且它工作正常。
我最初只有第一个范围设置,即写级别访问。这就是所有现有令牌的创建方式。在我的测试过程中,我添加了其他范围。
我尝试在我的项目中更新 Google API 的 NuGet 包。
这是我的班级正在打电话。
public class GoogleCalendarAdapter : ICalendarAdapter {
#region attributes
private readonly ISiteAuthTokenQueryRepository _tokenRepo;
private readonly GoogleCalendarSettings _settings;
private const string APPNAME = "REDACTED";
private const string ACL_OWNER = "owner";
private const string ACL_WRITER = "writer";
#endregion
#region ctor
public GoogleCalendarAdapter(ISiteAuthTokenQueryRepository tokenRepo,
GoogleCalendarSettings settings) {
_tokenRepo = tokenRepo;
_settings = settings;
}
#endregion
#region methods
private GoogleAuthorizationCodeFlow BuildAuthorizationCodeFlow() {
return new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer() {
ClientSecrets = BuildClientSecrets(), …Run Code Online (Sandbox Code Playgroud) 我有几个存储过程读取相同的表并以相同的布局返回数据.其中一个存储过程导致在存储为位的字段上发生无效的强制转换异常.该SqlDataReader认为,这是一个int32.
样本表
create table dbo.SampleTable
(
Id INT NOT NULL IDENTITY(1,1),
SomeText VARCHAR(40),
BoolValue BIT
)
Run Code Online (Sandbox Code Playgroud)
示例存储过程
create proc SampleProcedure
as
select Id,
SomeText,
BoolValue
go
Run Code Online (Sandbox Code Playgroud)
示例扩展类
using System;
using System.Data.SqlClient;
namespace SampleApp.Extensions{
public static class SampleModelExtension{
private const int INDEX_ID = 0;
private const int INDEX_SOMETEXT = 1;
private const int INDEX_BOOLVALUE = 2;
public static SampleModel ToSampleModel(this SqlDataReader rdr){
SampleModel myModel = new SampleModel();
myModel.Id = !rdr.IsDbNull(INDEX_ID) ? rdr.GetInt32(INDEX_ID) : 0;
myModel.SomeText = !rdr.IsDbNull(INDEX_SOMETEXT) …Run Code Online (Sandbox Code Playgroud) 我已经实现了一个通用的处理程序,作为ASP.Net中的一个宁静的Web服务.我在接收发布到此Web服务的XML文件时遇到问题.我实际上看不到任何被传递的东西.我已经浏览了请求对象的表单,查询字符串和文件属性.一切都是空的.我知道该文件已正确发布,因为我可以在使用端口嗅探器时看到它.
我该如何访问此文件?