我目前正在免费试用Windows Azure.我所做的就是将一个标准的MVC启动模板"My MVC Application"部署到服务中.
但是,在读取数据时,我会看到,当我在试用帐户时,零费用已经计算完了
01/10/2011 Windows Azure平台 - 所有服务区域2数据传输(GB)11.414393东南亚计算
那是11GB!页面全部是3Kb,我是唯一一个知道它存在的人,所以地球上的用途如何得到那么高.我试着打电话给MS支持,但他们没有提供任何解释,如果我不在介绍包中,我会收到这笔费用.
有没有人想到11GB的3Kb MVC模板?注意:我的ISP带宽没有相应的用法,所以它"不能"就是我.
更新:
用法从未解释过.微软自言自语,但最终无法为使用峰值提供任何解释.从那以后我没有经历过类似的问题.我不相信微软会故意将我们扯掉,因为这将是一个短期的收益,最终会适得其反,但就错误而言,他们显然没有办法钻进他们以任何有意义的方式向你收费的数字.
因此,我认为您的教训是,您必须在此服务上实施自己的指标,以交叉检查您将要收费的数字.
对于以下"项目",我在解析Unity for DI时会遇到一个非常烦人且无法解释的错误.
InvalidOperationException - 无法构造LogWriter类型.您必须配置容器以提供此值.
?ex.Message; "依赖项的解析失败,类型= \"WindowsFormsApplication1.Performance \",name = \"(none)\".\ r \n发生异常时:解析时.\ r \n \nException是:InvalidOperationException - LogWriter类型不能是您必须配置容器以提供此值.\ r \n ---------------------------------- -------------\r\NAT异常的时间,该容器是:\ r \n\r \n解决WindowsFormsApplication1.Performance,(无)\ r \n解决参数\ "LW \" 构造WindowsFormsApplication1.Performance的(Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter LW,Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionManager EM)\ r \n解决Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(无)\r \n"
?ex.StackTrace; "在Microsoft.Practices.Unity.UnityContainer.DoBuildUp(类型t,对象存在,字符串名称,IEnumerable
1 resolverOverrides) in e:\\Builds\\Unity\\UnityTemp\\Compile\\Unity\\Unity\\Src\\UnityContainer.cs:line 515\r\n at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable1 resolverOverrides)中的e:\ Builds\Unity\UnityTemp\Compile\Unity\Unity\Src\UnityContainer.cs:485行\在电子r \ñ在Microsoft.Practices.Unity.UnityContainer.Resolve(T型,字符串名称,ResolverOverride [] resolverOverrides):\构建\统一\ UnityTemp \编译\统一\统一\ SRC\UnityContainer.cs:线173 \在电子r \ñ在Microsoft.Practices.Unity.UnityContainerExtensions.Resolve [T](IUnityContainer容器,ResolverOverride []重写):\构建\统一\ UnityTemp \编译\统一\统一\ SRC\UnityContainerExtensions.cs:线504\r \ñ在WindowsFormsApplication1.Form1.OnLoad(EventArgs的发送)在d:\ Devzone \任务处理\ WindowsFormsApplication1\Form1.cs中:行33"
在一个表格中:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
IUnityContainer …Run Code Online (Sandbox Code Playgroud) 我当时希望使用TlbImp.exe为Excel Library 11.0创建一些dll.查看文档我应该期望在SDK bin中找到它,例如:
C:\ Program Files(x86)\ Microsoft Visual Studio 10.0\SDK\v3.5\Bin
但是当我去那里时它是空的.如果我在Windows资源管理器中进行搜索,我会得到以下信息:

所以我的问题是,是否TlbImp.exe仍然是要走的路还是已经进一步集成到Visual 2012中了?
如果它仍然是要走的路,我应该使用哪个版本的工具?关于生成的.dll将在哪个框架上运行是否重要?
我通过从DataGridView继承创建了一个自定义的Winforms控件.
自定义数据网格视图定义了它自己的列和映射.
但是,每当我将它从工具箱拖到表单的设计图面上时,表单都会为自定义控件中的每一列重新创建一个列控件(DataGridViewTextBoxColumn),这样我最终会得到我应该拥有的列数的两倍.
整个想法是控件已经"自我意识",所以我不需要表单做任何事情.很明显,我忽略了一些简单的东西,但我的网络比Windows更多,并没有立即突出的原因.

自定义数据网格:
partial class StrategyGrid
{
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle …Run Code Online (Sandbox Code Playgroud) 解决方案中的大多数项目都允许选择Active(x86)的构建平台

然而,一个不是:

我无法解决原因.它们都是针对.Net Framework 4的VS2010项目.我认为可能违规项目引用的是64位,但不是这样我不知道吗?有什么想法吗?
我有Visual Studio 2012 Ultimate,我从MSDN下载了Visual Studio 2012 ISO.尝试安装文档时:
我以管理员身份打开Visual Studio

按照安装的自述文件按照这些说明进行操作
在Visual Studio 2012的菜单栏上,选择"帮助","添加和删除帮助内容".
Help Viewer 2.0启动,显示"管理内容"选项卡.在"管理内容"选项卡上,选择"磁盘"选项按钮,选择"浏览(...)"按钮,然后导航到DVD驱动器.
选择helpcontentsetup.msha文件,然后选择"打开"按钮.
在"可用文档"下,将显示DVD中可用内容集的列表.
选择要安装到本地计算机上的内容集旁边的"添加"链接.您指定的项目将显示在"待定更改"列中.您可以通过选择项目旁边的"X"从"待更改"列中删除项目.选择"更新"按钮.

然后单击"更新"
当我单击"更新"时,它会持续约3-4秒,然后失败并显示错误:
执行请求的任务时发生以下错误:
更新内容时发生错误.您没有足够的权限来完成此任务.

我该如何解决这个问题?
更新
我在管理员模式下运行帮助查看器.

有一些简单的代码可以使用以下命令将带有私钥的证书导入到 Windows 证书存储中.net core 2.2:
using (var store = new X509Store(StoreName.Root,StoreLocation.CurrentUser))
{
store.Open(OpenFlags.ReadWrite);
store.Add(cert);
store.Close();
}
Run Code Online (Sandbox Code Playgroud)
还有一些同样简单的代码可以再次将其读出来:
using (var store = new X509Store(StoreName.Root,StoreLocation.CurrentUser))
{
store.Open(OpenFlags.ReadOnly);
var certCollection = store.Certificates.Find(X509FindType.FindBySubjectName, commonName, validOnly);
store.Close();
return certCollection;
}
Run Code Online (Sandbox Code Playgroud)
然而,尽管证书已成功检索到 certCollection 中,但它的私钥为 null 并且 hasPrivateKey 为 false,即使它们在之前的调用中不为 null 且为 true Add。为什么是这样?
更新:
using (RSA rsa = RSA.Create(keySize)) {
CertificateRequest certRequest = new CertificateRequest(
subjectName,
rsa,
HashAlgorithmName.SHA512,
RSASignaturePadding.Pkcs1);
certRequest.CertificateExtensions
.Add(newX509SubjectKeyIdentifierExtension(certRequest.PublicKey, false));
return certRequest;
}
Run Code Online (Sandbox Code Playgroud) 我试着:
((Request.Params["crmid"] != null))
Run Code Online (Sandbox Code Playgroud)
在网页中.但它不断抛出序列化异常:
类型"QC.Security.SL.SiteUser"在组件"QC.Security,版本= 1.0.0.1,文化=中性公钥=空"未标记为可序列.
然而,类型(自定义IIdentity)标记为可序列化如下:
[Serializable()]
public class SiteUser : IIdentity
{
private long _userId;
public long UserId { get { return _userId; } set { _userId = value; } }
private string _name;
public string Name { get { return _name; } }
private bool _isAuthenticated;
public bool IsAuthenticated { get { return _isAuthenticated; } }
private string _authenticationType;
public string AuthenticationType { get { return _authenticationType; } }
Run Code Online (Sandbox Code Playgroud)
我不知道如何调试这个,因为我无法进入序列化器代码,以找出它为什么会摔倒.调用堆栈在到达[外部代码]之前只有一帧深度.并且错误消息是无用的,因为类型明确标记为可序列化.试验和错误调整也产生了一个类型未解决的成员异常.
它工作正常.但现在"突然间"它并不通常意味着Visual Studio中的一些愚蠢的错误,但重启并没有帮助"这个"时间.所以现在我不知道这是一个愚蠢的VS错误还是一个完全不相关的错误,我得到了序列化异常或者我做错了什么.
事实上,我不再相信VS了,因为过去几个月我一直在进行的疯狂追逐数量,这是通过重新启动VS 2008或其他一些荒谬的解决办法来"修复"的.
我有一些非常古老的VB.Net代码:
Private Function Min(ByVal A As Object, ByVal B As Object) As Object
If A Is DBNull.Value Or B Is DBNull.Value Then Return DBNull.Value
If A < B Then Return A Else Return B
End Function
Run Code Online (Sandbox Code Playgroud)
别担心.编译器吃它....并要求更多.但转换为C#时:
private object Min(object A, object B)
{
if (object.ReferenceEquals(A, DBNull.Value) | object.ReferenceEquals(B, DBNull.Value))
return DBNull.Value;
return A < B ? A : B;
}
Run Code Online (Sandbox Code Playgroud)
编译器扼杀它上面的错误信息:
Cannot apply operator '<' with operands of object and object
Run Code Online (Sandbox Code Playgroud)
那么,哟哟哟?
有一种方法可以检查ReturnValue参数的SqlParameterCollection,如果存在,则检查该约束违规的值.
public static void VerifyUniqueness(this ISqlServerProvider provider,
OperationType operationType, SqlParameterCollection cp)
Run Code Online (Sandbox Code Playgroud)
在这种方法中,我认为首先检查是足够的:
if (cp["@ReturnValue"]==null){return;}
Run Code Online (Sandbox Code Playgroud)
但是如果"@ReturnValue"== null则会引发异常,所以我认为我会使用Linq:
cp.FirstOrDefault(p => p.ParameterName == "@ReturnValue");
Run Code Online (Sandbox Code Playgroud)
但那甚至不会编译.
'System.Data.SqlClient.SqlParameterCollection'不包含'FirstOrDefault'的定义,并且没有可以找到接受类型'System.Data.SqlClient.SqlParameterCollection'的第一个参数的扩展方法'FirstOrDefault'(你是否缺少using指令?或汇编参考?)
System.Linq被引用,因此不确定发生了什么.