小编Eth*_*nHY的帖子

使用.net 4.5在VS2012中创建自定义STS服务

因为我是WIF的新手.我想在WIF上创建自定义STS,但这些文档仅适用于.net 3.5:http: //msdn.microsoft.com/en-us/library/ee748498.aspx ,我在vs 2012中找不到这些模板.所以我该怎么做?任何人都可以向我提供一些信息吗?谢谢 !

wcf wif

5
推荐指数
1
解决办法
1万
查看次数

如何制作实体框架代码首先使用SQL Azure DB?

我现在开始学习EF了.我想要做的是使用EF代码首先在SQL Azure中创建新表.

这是我的代码:

namespace WebApplication2
{
   public class Blog
   {
       public int UserName { get; set; }
       public int ID { get; set; }
   }

   public class BlogContext : DbContext
   {
       public DbSet<Blog> Blogs { get; set; }

       public BlogContext() : base("MYEF")
       {
       }
   }
}
Run Code Online (Sandbox Code Playgroud)

代码背后:

 protected void Page_Load(object sender, EventArgs e)
 {
        using (var db = new BlogContext())
        {
            var blog = new Blog { UserName = 456 };
            db.Blogs.Add(blog);
            db.SaveChanges();
        }
    }
Run Code Online (Sandbox Code Playgroud)

Web.config:

<connectionStrings>
    <add name="TestDBContext" …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework azure ef-code-first azure-sql-database

4
推荐指数
1
解决办法
9337
查看次数

403禁止从Web角色实例调用Azure rest api时

我有一个非常奇怪的问题.我发布了一个webrole到azure云服务.在这个项目中,它需要webrole调用Azure Rest API,我可以在本地模拟器中获取响应,但是,如果我将其发布到Azure,我会得到403禁止错误.我确信我已将证书安装到Azure.

可以通过以下步骤重现此错误:

  1. 首先使用以下链接创建证书:http://msdn.microsoft.com/en-us/library/windowsazure/gg651127.aspx
  2. 使用webrole创建云服务,Azure门户中的证书,云服务证书和webrole-> property-> certificate.
  3. 发布项目.
  4. 远程登录Web角色实例.
  5. 在本地创建一个控制台应用程序,然后将调试文件夹复制到远程实例并在远程应用程序中运行exe.你可以发现应用程序可以在本地运行完美,但在Azure实例中,似乎它可以找到证书,但仍然得到403禁止错误.

控制台应用代码:

static void Main(string[] args)
    {
        try
        {
            // X.509 certificate variables.
            X509Store certStore = null;
            X509Certificate2Collection certCollection = null;
            X509Certificate2 certificate = null;

            // Request and response variables.
            HttpWebRequest httpWebRequest = null;
            HttpWebResponse httpWebResponse = null;

            // Stream variables.
            Stream responseStream = null;
            StreamReader reader = null;

            // URI variable.
            Uri requestUri = null;

            // Specify operation to use for the service management call.
            // …
Run Code Online (Sandbox Code Playgroud)

azure

4
推荐指数
1
解决办法
4051
查看次数

如何使用fidder2检查Windows Azure https请求

我想使用fiddler检查Azure Powershell发送的https请求,但是当我收到https请求时,它将返回由azure portal禁止的403.有人能解决这个问题吗?非常感谢!!!!

powershell https wcf fiddler azure

2
推荐指数
1
解决办法
929
查看次数

This.Task()给VB得到一个错误,如何解决?

对于C#代码

public Action Task { get; set; }

this.Task();
Run Code Online (Sandbox Code Playgroud)

但在VB中:

 Public Property Task() As Action
        Get
            Return m_Task
        End Get
        Set(value As Action)
            m_Task = Value
        End Set
    End Property
 Me.Task()
Run Code Online (Sandbox Code Playgroud)

不管用.如何解决这个问题?

c# vb.net

2
推荐指数
1
解决办法
136
查看次数

如何启动Azure VM(取消分配)使用REST API

我在这里发现了一个非常奇怪的问题:在Azure powershell中,我们可以使用Start-AzureVM -ServiceName"mypc"-Name"mypc"进行VM状态=停止或停止(取消分配).但对于Azure Mangement API,我们只能将启动角色用于VM state = stop

VM state = stop(deallocated)无法使用该API.如何使用REST API以State = Stop(deallocated)启动VM?谢谢.

azure azure-powershell

1
推荐指数
1
解决办法
2776
查看次数