2015-08-18 69 views
1

我在Visual Studio 2012 Express中創建了一個ASP MVC 4 Web應用程序。我想與Facebook保持一致,並開始尋找文檔,並在示例項目的App_Start文件夾中看到對AuthConfig.cs文件的引用。Missing AuthConfig.cs

我看着我的項目,並且我的App_Start文件夾中沒有AuthConfig.cs。看了一下後,我看到我需要使用NuGet來安裝DotNetOpenAuth包,所以我去了並安裝它,但令我驚訝的是,我的App_Start文件夾中仍然沒有AuthConfig.cs文件。

有沒有人有這個問題或知道我可以如何解決這個問題?

回答

0

嘗試創建一個新項目。

Startup.CS包含以下代碼。

using Microsoft.Owin; 
using Owin; 

[assembly: OwinStartupAttribute(typeof(Gather.Startup))] 
namespace Gather 
{ 
    public partial class Startup 
    { 
     public void Configuration(IAppBuilder app) 
     { 
      ConfigureAuth(app); 
     } 
    } 
} 

只是檢查,如果你有以下軟件包:

<?xml version="1.0" encoding="utf-8"?> 
<packages> 
    <package id="Antlr" version="3.4.1.9004" targetFramework="net45" /> 
    <package id="bootstrap" version="3.0.0" targetFramework="net45" /> 
    <package id="EntityFramework" version="6.0.0" targetFramework="net45" /> 
    <package id="jQuery" version="1.10.2" targetFramework="net45" /> 
    <package id="jQuery.Validation" version="1.11.1" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Identity.Core" version="1.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Identity.EntityFramework" version="1.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Identity.Owin" version="1.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" /> 
    <package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" /> 
    <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Host.SystemWeb" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.Cookies" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.Facebook" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.Google" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.MicrosoftAccount" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.OAuth" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Owin.Security.Twitter" version="2.0.0" targetFramework="net45" /> 
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" /> 
    <package id="Modernizr" version="2.6.2" targetFramework="net45" /> 
    <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" /> 
    <package id="Owin" version="1.0" targetFramework="net45" /> 
    <package id="Respond" version="1.2.0" targetFramework="net45" /> 
    <package id="WebGrease" version="1.5.2" targetFramework="net45" /> 
</packages>