我正在使用Visual Studio 2008,我刚刚注意到当我将鼠标悬停在变量上以及在即时窗口中时,调试器将整数值显示为十六进制.我想我必须意外地碰到一个快捷键或什么的.
以前有人有吗?如何将其设置为以十进制显示?
将我的模板上传到 CloudFormation 时,我收到以下验证错误:
模板验证错误:模板错误:Fn::ImportValue 中的属性不能依赖于任何资源、导入的值或 Fn::GetAZs
我在下面有一个重现问题的测试模板:
Resources:
EC2Instance:
Type: "AWS::EC2::Instance"
Properties:
ImageId: ami-3bfab942
InstanceType: t2.micro
KeyName: mykeypair
UserData:
"Fn::Base64":
!Sub |
#!/bin/bash
yum update -y aws-cfn-bootstrap
/opt/aws/bin/cfn-init -v --stack ${AWS::StackName} --resource EC2Instance --configsets testset --region ${AWS::Region}
yum -y update
Metadata:
AWS::CloudFormation::Init:
configSets:
testset:
- "testConfiguration"
testConfiguration:
commands:
CreateTestFile:
cwd: "~"
command:
"Fn::ImportValue":
!Sub |
touch ${myexport}
Run Code Online (Sandbox Code Playgroud)
为了让事情尽可能简单,我基本上是在尝试使用导出创建一个 bash 命令。所以在上面的例子中,我想创建一个基于导出值命名的文件。我不明白我正在尝试做的事情的上下文中的错误消息。我已经验证导出存在于我创建的另一个堆栈中。
我正在尝试使用System.Activator.CreatInstance来创建基于typeName的对象.我正在使用以下代码:
Object DataInstance = System.Activator.CreateInstance(
System.Reflection.Assembly.GetExecutingAssembly().FullName,
"CMS.DataAccess.SQLWebSite");
IWebSite NewWebPage = (IWebSite)DataInstance;
Run Code Online (Sandbox Code Playgroud)
SQLWebSite实施IWebSite.但是,我收到以下错误:"无法将类型为'System.Runtime.Remoting.ObjectHandle'的对象强制转换为'CMS.DataAccess.IWebSite'." 我出错的任何想法?