我已经将目前针对VS2010中的.NET 4.0的解决方案迁移到VS2012,现在我想将其重新定位到.Net 4.5
我不确定的是NuGet包.例如,我在VS2010中从EF4更新的EF5实际上是EF 4.4,如下所示:
    <Reference Include="EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\packages\EntityFramework.5.0.0\lib\net40\EntityFramework.dll</HintPath>
    </Reference>
Run Code Online (Sandbox Code Playgroud)
我还可以在packages.config中看到以下项目:
<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="5.0.0" targetFramework="net40" />
</packages>
Run Code Online (Sandbox Code Playgroud)
所以我的问题是:
将目前设置为.NET 4.0的所有NuGet包重新定位到目标.NET 4.5的最佳做法是什么?
我试图将导出的BACPAC从SQL Azure(v12)数据库导入到本地SQL Server 2012实例中,但我一直收到以下错误.我已经尝试安装从这篇博客文章链接的DAC和SSDT更新,但它没有帮助.
我怎样才能解决这个问题?
TITLE: Microsoft SQL Server Management Studio
------------------------------
Count not load schema model from package. (Microsoft.SqlServer.Dac)
------------------------------
ADDITIONAL INFORMATION:
Internal Error. The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid. You must make sure the service is loaded, or you must provide the full type name of a valid database platform service. (Microsoft.Data.Tools.Schema.Sql)
------------------------------
BUTTONS:
OK
------------------------------
Run Code Online (Sandbox Code Playgroud) 我已经使用Nhibernate 2.1从Fluent Nhibernate 1.0升级到使用NHibernate 3.0 GA预发布1.x并且达到了我认为的回归,但我想知道是否确实如此.
我使用的是SQL Server Express 2008和MSSQL 2008方言,并且具有System.Drawing.Image类型的Image属性,我已将其映射为:
Map (food => food.Image)
 .Length (int.MaxValue)
 .Nullable ();
Run Code Online (Sandbox Code Playgroud)
Image表中的列是类型varbinary(MAX).
生成的属性的hbm是:
<property name="Image" type="System.Drawing.Image, System.Drawing,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   <column name="Image" length="2147483647" not-null="false" />
</property>`
Run Code Online (Sandbox Code Playgroud)
但是无论我做什么,当使用当前的FNH和NH版本序列化时,二进制blob被截断为8000字节.以前的版本不是这种情况.
想法为什么会这样,以及如何解决/解决它?
我在Visual Studio Android模拟器(2016年4月发布)中有一个Android Marshmallow设备,它启动正常,似乎工作.但是,在运行时,该XDE.exe过程会占用我的CPU(35-40%+),而Hyper-V仅使用~8-10%最大值.
这是正常和预期的行为吗?如果没有,我该如何解决?
我能够跟踪以下DLL的高CPU使用率:
C:\ Program Files(x86)\ Microsoft XDE\10.0.10586.0\Plugins\Microsoft.VisualStudio.Emulator.XdePlugin.dll
...以及运行此方法的以下线程,这是一个循环:
Microsoft.VisualStudio.Emulator.StatusCallback.XdeDeviceStatusCallbackService.StatusCallbackThreadProc()
运行Windows 10移动模拟器映像时,我没有看到XDE的高CPU使用率.
我最近迁移并重新设计了从VS 2010和.NET 4.0到VS 2012和.NET 4.5的解决方案.然而,现在突然而且随机的VS 2012报告了几乎所有的跨项目参考:
"The referenced component X could not be found" (warning)
Run Code Online (Sandbox Code Playgroud)
现在,我知道这是不正确的事实.首先是因为我可以在为程序集引用设置的目录中看到程序集,其次是因为当我调出"Add Reference"对话框时,警告突然消失,所以程序集引用上的黄色警告图标也是如此
执行完全重建会清除警告,然后它将保持一段时间,然后随机显示相同的警告.
有没有人见过这个?可能是什么原因以及如何解决?
编辑:我在VS 2010中没有看到这种奇怪的行为
编辑:报告警告以引用同一解决方案中的其他项目.
Ninject目前面临的挑战是,当我使用Rebind<>()它时,它会删除所有绑定,即使是那些有条件的绑定.我在下面给你一个愚蠢的例子.基本上我发现在我的情况下不受欢迎的行为是,当调用Rebind时,它将删除条件WhenInjectedInto<T>绑定而不是仅覆盖非条件绑定Bind<T>.在合同下方的样本中Contract.Assert(cat is Wild);在重新绑定后,中将失败.
有没有办法做我想要的 - 保持已注入条件绑定并仅覆盖非条件绑定的能力?
PS:实际上我正在尝试使用DataContext范围做一些有趣的事情,具体取决于它们的注入位置(在请求或异步命令中)
void Main()
{
    StandardKernel kernel = new StandardKernel();
    kernel.Bind<ICat>().To<Wild>();
    kernel.Bind<ICat>().To<Wild>()
        .WhenInjectedInto<EvilCat>();
    kernel.Rebind<ICat>().To<Domestic>();
    Contract.Assert(kernel.Get<ICat>() is Domestic);
    kernel.Get<EvilCat>();
}
interface ICat {}
class Domestic : ICat {}
class Wild : ICat { }
class EvilCat
{
    public EvilCat(ICat cat) {
        Contract.Assert(cat is Wild);
    }
}
Run Code Online (Sandbox Code Playgroud) 我有以下配置,但没有跟踪到Application Insights(否则Application Insights可以正常用于其他日志记录,Azure诊断侦听器也在工作并捕获跟踪).难道我做错了什么?
<system.diagnostics>
    <trace autoflush="true" indentsize="0">
      <listeners>
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
        </add>
        <add name="myAppInsightsListener" type="Microsoft.ApplicationInsights.TraceListener.ApplicationInsightsTraceListener, Microsoft.ApplicationInsights.TraceListener" />
      </listeners>
    </trace>
  </system.diagnostics>
Run Code Online (Sandbox Code Playgroud) system.diagnostics azure azure-diagnostics azure-application-insights
我有一个Visual Studio 2012解决方案,其中包含三个Web项目.他们每个人都有一个Web部署发布配置文件,它在特定目录中创建一个包.解决方案本身也有一个特殊的部署配置.
使用msbuild,在部署配置中构建解决方案很简单,但是如何使用msbuild构建脚本/任务(而不是调用命令行)使用特定的配置文件发布3个Web项目?
我有一个Azure Web App,它与第三方API通信,后者使用OAuth 1.0a或类似的,并且作为其中一部分需要SSL证书.我需要使用提供的SSL证书带有自己的证书链(根证书,中间证书和SSL证书).
我已将证书链导出到.pfx文件,并将其上载到Azure预览门户中的SSL证书部分,并WEBSITE_LOAD_CERTIFICATES *在应用程序设置中使用.
问题是root和临时证书不会被导入.这是预期的行为,我该如何解决?或者这是Azure Web Apps不支持的内容吗?
编辑:
我导出证书链的方式是使用PowerShell:
Export-PfxCertificate -Force 
                      -ChainOption BuildChain
                      –Cert cert:\localmachine\my\#mythumbprint# 
                      –FilePath c:\temp\myexport.pfx 
                      -Password $(ConvertTo-SecureString -String "password" -Force –AsPlainText)
Run Code Online (Sandbox Code Playgroud) 我的问题是:
在我的方案中注入自定义关联/操作ID的正确/更好的方法是什么,这不会导致内存泄漏并且在Azure门户上正确使用和显示?
以下是我的方案的具体细节:
我有一个Azure辅助角色,它不断地从Azure队列中出列消息并进行处理.该消息包含相关ID(操作ID)和操作名称,我希望将其用于在该消息的处理工作期间通过Application Insights收集和推送的所有遥测.
目前实现的方式是通过自定义ITelemetryInitializer,看起来像这样:
public class MiTelemetryInitialiser : ITelemetryInitializer
{
    private readonly ILoggingContext _context;
    public MiTelemetryInitialiser(ILoggingContext context)
    {
        _context = context;
    }
    public void Initialize(ITelemetry telemetry)
    {
        if (string.IsNullOrEmpty(telemetry.Context.Operation.Id) && _context != null)
        {
            telemetry.Context.Operation.Id = _context.OperationId;
            if (!String.IsNullOrWhiteSpace(_context.OperationName))
                telemetry.Context.Operation.Name = _context.OperationName;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)
然后我的worker角色处理循环看起来像这样(si:
while(!cancellationToken.IsCancellationRequested) {
    // 1. Get message from the queue
    // 2. Extract operation name and Correlation Id from the message
    TelemetryConfiguration config = TelemetryConfiguration.CreateDefault();
    var loggingContext = //new logging context …Run Code Online (Sandbox Code Playgroud)