2014-02-27 2 views
0

SOLVED : 문제를 발견하여 이전 멤버쉽 공급자 시스템에서 약간의 코드로 판명되었습니다. SQL Express 인스턴스가 기본값 인 Membership 저장소를 만듭니다.MVC 5 프로젝트 배포 - SQLExpress 데이터베이스 파일 자동 생성 오류

나는 웹 서버에 내 MVC 5 프로젝트를 배포 다음과 같은 오류를 받고 있어요 : SQL 서버에 연결하는 동안

네트워크 관련 또는 인스턴스 관련 오류가 발생했습니다. 서버를 찾을 수 없거나 액세스 할 수 없습니다. 인스턴스 이름이 올 바르고 SQL Server가 원격 연결을 허용하도록 구성되어 있는지 확인하십시오. (공급자 : SQL 네트워크 인터페이스, 오류 : 26 - 서버/인스턴스 지정 오류 지정)

설명 현재 웹 요청을 실행하는 동안 처리되지 않은 예외가 발생했습니다. 오류 및 코드에서 시작된 위치에 대한 자세한 정보는 스택 추적을 검토하십시오.

SQLExpress입니다 데이터베이스 파일 자동 생성 오류 :

연결 문자열이 응용 프로그램의 App_Data 디렉터리 내의 데이터베이스 위치를 사용하여 로컬 SQL Server Express 인스턴스를 지정합니다. 공급자가 데이터베이스가 존재하지 않는다고 판단했기 때문에 공급자는 응용 프로그램 서비스 데이터베이스를 자동으로 만들려고했습니다. 응용 프로그램 서비스 데이터베이스의 존재를 확인하고 응용 프로그램 서비스 데이터베이스를 자동으로 만들려면 다음 구성 요구 사항이 필요합니다.

SQL Express 인스턴스를 만들려는 이유를 이해할 수 없으며 웹에 아무 것도 지정되어 있지 않습니다. config. 나는 (MVC 5 Identity가 어떻게 작동하는지와 관련이있는) 직감을 가지고있다. 다음은 내 Web.config의는 다음과 같습니다

<?xml version="1.0"?> 

<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=301874 --> 

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
    <!-- 
    In the example below, the "SetAttributes" transform will change the value of 
    "connectionString" to use "ReleaseSQLServer" only when the "Match" locator 
    finds an atrribute "name" that has a value of "MyDB". 
--> 
    <connectionStrings> 
     <clear /> 
     <add name="ManaIdentity" 
     providerName="System.Data.SqlClient" 
     connectionString="Server=DeploymentServer;    
          Database=ManaIdentity;    
          UID=someone;    
          PWD=somepassword;    
          Integrated Security=False;    
          MultipleActiveResultSets=True;" 
     xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> 
    </connectionStrings> 

    <system.web> 
    <compilation xdt:Transform="RemoveAttributes(debug)" /> 
    <!-- 
     In the example below, the "Replace" transform will replace the entire 
     <customErrors> section of your Web.config file. 
     Note that because there is only one customErrors section under the 
     <system.web> node, there is no need to use the "xdt:Locator" attribute. 

     <customErrors defaultRedirect="GenericError.htm" 
     mode="RemoteOnly" xdt:Transform="Replace"> 
     <error statusCode="500" redirect="InternalError.htm"/>--> 

    </system.web> 
</configuration> 

건배 :

여기
<?xml version="1.0" encoding="utf-8"?> 
<!-- 
    For more information on how to configure your ASP.NET application, please visit 
    http://go.microsoft.com/fwlink/?LinkId=301880 
    --> 
<configuration> 
    <configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    </configSections> 
    <connectionStrings> 
     <add name="ManaIdentity" 
      providerName="System.Data.SqlClient" 
      connectionString="Server=DevelopmentMachine;    
          Database=ManaIdentity;    
          UID=someone;    
          PWD=somepassword;    
          Integrated Security=False;    
          MultipleActiveResultSets=True;" /> 
    </connectionStrings> 
    <appSettings> 
    <add key="webpages:Version" value="3.0.0.0" /> 
    <add key="webpages:Enabled" value="false" /> 
    <add key="ClientValidationEnabled" value="true" /> 
    <add key="UnobtrusiveJavaScriptEnabled" value="true" /> 
    </appSettings> 
    <system.web> 
    <authentication mode="None" /> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" /> 
    <customErrors mode="Off"/> 
    </system.web> 
    <system.webServer> 
    <modules> 
     <remove name="FormsAuthenticationModule" /> 
    </modules> 
    <handlers> 
     <remove name="ExtensionlessUrlHandler-Integrated-4.0" /> 
     <remove name="OPTIONSVerbHandler" /> 
     <remove name="TRACEVerbHandler" /> 
     <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" /> 
    </handlers> 
    </system.webServer> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" /> 
     </dependentAssembly> 
     <dependentAssembly> 
     <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> 
     <bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
    <entityFramework> 
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> 
    <providers> 
     <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    </providers> 
    </entityFramework> 
</configuration> 

내 web.release.config입니다! .) (

VAR 사용자 = @ Membership.GetUser;

답변

1

가 좋아, 내가에서 왼쪽했던 옛 멤버 자격 공급자 코드의 비트를 밝혀졌다 이것은 잘못된 코드이었다

관련 문제