小编lev*_*ter的帖子

无法从HRESULT加载文件或程序集异常:0x80131040

我创建了我的第一个MVC 4项目,它在本地服务器上运行良好.但是当我将它发布到本地文件夹并将文件夹内容上传到托管服务器时.我尝试运行它,我得到这个错误:

无法加载文件或程序集'DotNetOpenAuth.Core,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 2780ccd10d57b246'或其依赖项之一.该系统找不到指定的文件.有人能帮帮我吗?

Web.config文件:

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
  </dependentAssembly>
</assemblyBinding>
Run Code Online (Sandbox Code Playgroud)

PS Web窗体中的相同项目适用于托管服务器.

asp.net asp.net-mvc asp.net-mvc-4 visual-studio-2012

24
推荐指数
3
解决办法
10万
查看次数

在一次通话中从多个表中选择

在我的代码中,我有一个页面,其中包含来自3个不同表格的信息.为了显示这些信息,我做了3个SQL select调用,并将它们统一在一个列表中,作为Model传递给我的视图.我可以用一个SQL调用吗?数据彼此之间没有联系.

我的代码:

public ActionResult Index()
{
    StorePageData PageData = new StorePageData();
    return View(PageData);
}
public class StorePageData
{
     public List<Table1Data> Table1 { get; set; }
     public List<Table2Data> Table2 { get; set; }
     public List<Table3Data> Table3 { get; set; }

     public StorePageData()
     {
          Table1  = //loading from Database1
          Table2  = //loading from Database2
          Table3  = //loading from Database3
     }
}
public class Table1Data
{
     public int Id { get; set; }
     public double Info1 { get; set; }
     public string …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc sql-server-2008

13
推荐指数
2
解决办法
4495
查看次数

在asp net中从facebook获取用户电子邮件

我正在尝试从Facebook获取用户名和用户电子邮件.我阅读了很多关于这个主题的信息,这是我的最终代码,仅在我的facebook app管理员帐户上有效:

public partial class Startup
{
    public void ConfigureAuth(IAppBuilder app)
    {

        /*Other external login options*/

         var FacebookOptions = new FacebookAuthenticationOptions()
                {
                    AppId = "My App Id",
                    AppSecret = "My App Secret",
                    SignInAsAuthenticationType = DefaultAuthenticationTypes.ExternalCookie,
                    BackchannelHttpHandler = new FacebookBackChannelHandler(),
                    UserInformationEndpoint = "https://graph.facebook.com/v2.7/me?fields=id,name,email"
                };


    }
}
public class FacebookBackChannelHandler : HttpClientHandler
{
    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
    {
        if (!request.RequestUri.AbsolutePath.Contains("/oauth"))
        {
            request.RequestUri = new Uri(request.RequestUri.AbsoluteUri.Replace("?access_token", "&access_token"));
        }

        return await base.SendAsync(request, cancellationToken);
    }
}
public class AccountController : Controller …
Run Code Online (Sandbox Code Playgroud)

c# asp.net oauth facebook-oauth

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

CSS在div内部对齐100%宽度

我在我的问题上搜索了答案,但奇怪的是没找到它.我需要在主div内对齐4个div.主div的宽度应为100%,每个内部div应为主div的25%,以便在一行中实现4个相同宽度的div.我的代码是:

html {
  margin: 0;
  padding: 0;
  width: 100%;
}
body {
  margin: 0;
  padding: 0;
  width: 100%;
}
.container {
  margin: 0;
  padding: 0;
  width: 100%;
  display: block;
}
.inner-div {
  display: inline-block;
  width: 25%;
}
.yellow {
  background-color: yellow;
}
.blue {
  background-color: blue;
}
.red {
  background-color: red;
}
.green {
  background-color: green;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container">
  <div class="inner-div yellow">
    yellow
  </div>
  <div class="inner-div blue">
    blue
  </div>
  <div class="inner-div red">
    red
  </div>
  <div class="inner-div green">
    green
  </div>
</div> …
Run Code Online (Sandbox Code Playgroud)

html css

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