我有一个当前正在运行的存储过程,似乎挂起/锁定特定查询.我怎么才能看到哪个查询?优选地,不修改过程.
运用
DBCC Inputbuffer (65)
Run Code Online (Sandbox Code Playgroud)
给我
语言事件0 EXEC mySP;
由于使用标志支持Web Deploy 3.5连接字符串的自动加密:–EnableRule:EncryptWebConfig
.但是,运行它时:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='C:\[...]\MyApp.WebDeployPackage.zip' -dest:auto,includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\[...]\MyApp.SetParameters.xml" -EnableRule:EncryptWebConfig -verbose
Run Code Online (Sandbox Code Playgroud)
我明白了:
Error Code: ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG
More Information: Failed to encrypt destination web.config: C:\[...]\Web.config.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG.
Error: The given key was not present in the dictionary.
Run Code Online (Sandbox Code Playgroud)
在详细了解链接到过时的文档点,我似乎无法在网上找到任何信息.
我怀疑该工具在幕后使用aspnet_regiis,但我不确定.是的,我正在使用完全管理员权限运行上述内容.
尝试在Visual Studio中使用ifdef DEBUG常量在.NET Framework 4.5,ASP.NET MVC 4中对我不起作用.
我确定:
<compilation debug="true"...
我用来验证的代码在IDE和运行时都显示isDebug = false,即使我在Debug-configuration下运行:
bool isDebug;
#if DEBUG
isDebug = true;
#else
isDebug = false;
#endif
Run Code Online (Sandbox Code Playgroud)
这是Visual Studio的屏幕上限,显示我已将Debug-configuration激活,但在代码中,颜色突出显示DEBUG未定义.
我肯定错过了什么!
编辑:属性窗口显示的构建视图的屏幕截图:
是否有Visual Studio的GUI或插件来管理实体框架代码优先迁移?例如,一个有用的功能是您可以从列表中选择迁移并使用它作为TargetMigration执行Update-Database.
(我正在考虑编写这样的工具,但不确定如何与Nuget Package Manager控制台进行通信,其中插入了命令.)
我在代码优先迁移中有以下代码:
public partial class RunSQLInit : DbMigration
{
public override void Up()
{
this.Sql(SqlFiles.Create_Job_ClearExpiredData);
}
[...]
}
Run Code Online (Sandbox Code Playgroud)
哪里SqlFiles.Create_Job_ClearExpiredData
是一个以字符串形式返回 SQL 文件的 resx 文件。SQL 在 SQL Server 中创建和调度服务器代理作业。
现在,SQL 有两个“变量”,我需要在对数据库运行迁移之前进行更改:作业应该运行的数据库的名称,以及实际作业的名称。如果我只有一个环境,那会很好,但是我将这个代码优先项目部署到多个环境中,这些环境在数据库名称和我应该称之为 Job 的内容上有所不同。
我看到了三种可能性:
Update-Database
在包管理器控制台中运行时,以某种方式将变量传递给迁移,该变量可以在迁移内部访问。我该怎么做?Update-Database -script
)有问题的 SQL 脚本的一小部分是这样的:
EXEC msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Run SP',
@step_id=1,
@subsystem=N'TSQL',
@command=N'exec sp_ClearExpiredData;',
@database_name=@databaseName, --This is where I need the varying database name!
@flags=0
Run Code Online (Sandbox Code Playgroud) dotnet build
在.NET Core项目上运行命令时出现以下错误。
C:\Program Files\dotnet\sdk\2.1.2\Microsoft.Common.CurrentVersion.targets(4106,5
): warning MSB3026: Could not copy "obj\Debug\netcoreapp2.0\Blog-Yantra.dll" to
"bin\Debug\netcoreapp2.0\Blog-Yantra.dll". Beginning retry 1 in 1000ms. The proc
ess cannot access the file 'E:\learn\blog\Blog-Yantra\bin\Debug\netcoreapp2.0\Bl
og-Yantra.dll' because it is being used by another process. [E:\learn\blog\Blog
-Yantra\Blog-Yantra.csproj]
Run Code Online (Sandbox Code Playgroud)
我的csproj文件如下所示:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TypeScriptToolsVersion>2.3</TypeScriptToolsVersion>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>
</Project>
Run Code Online (Sandbox Code Playgroud) 通过运行:
aspnet_regiis.exe -pef "connectionStrings" C:\inetpub\wwwroot\Site
Run Code Online (Sandbox Code Playgroud)
我可以加密我的连接字符串。但是,我想同时加密另一个部分。有什么方法可以给多个参数-pef
?
就像是:
aspnet_regiis.exe -pef "connectionStrings,applicationSettings/Project" C:\inetpub\wwwroot\Site
Run Code Online (Sandbox Code Playgroud) 参考问题Windows 7 Map CTRL + j to the Down Arrow Key
如何像vim一样使用AutoHotKey映射箭头键?
Ctrl+h = Move left
Ctrl+j = Move down
Ctrl+k = Move up
Ctrl+l = Move right
Run Code Online (Sandbox Code Playgroud) .net ×3
asp.net ×3
c# ×3
encryption ×2
sql-server ×2
web-config ×2
.net-core ×1
autohotkey ×1
code-first ×1
dbcc ×1
iis ×1
msdeploy ×1
sql ×1
t-sql ×1
vim ×1