我一直在搜索解決我的問題的各種搜索源。我已經發布了IIS上的一個網站,我一直在努力,這是我第一次發佈的網站上IIS。發佈時連接到DB.mdf時出錯IIS
我似乎無法連接到數據庫。
我會提供我已經在這裏做降權的一切..
欣賞任何幫助,請....
我web.config
文件中發佈的網站目錄C:\FinancialHubTest
。從cmd在
applicationHost文件 在一個側面說明我也試過在我web.config
文件中添加User Instance=True
我的連接字符串,但它不工作..
<connectionStrings>
<!--<add name="ConnStr" connectionString="Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFileName=|DataDirectory|\FinancialHub.mdf;Integrated Security=True" />-->
<add name="ConnStr"
connectionString="Data Source=(LocalDB)\.\IIS_DB;Integrated Security=True;" />
</connectionStrings>
詳細用Notepad2編輯的C:\ Windows \ System32 \ inetsrv \ config。 我在IIS中使用FinancialHub作爲我applicationPool我發佈的網站
<applicationPools>
<add name="DefaultAppPool" managedRuntimeVersion="v4.0" />
<add name="Classic .NET AppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />
<add name=".NET v2.0 Classic" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" />
<add name=".NET v2.0" managedRuntimeVersion="v2.0" />
<add name=".NET v4.5 Classic" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" />
<add name=".NET v4.5" managedRuntimeVersion="v4.0" />
<add name="FinancialHub" autoStart="true" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="true" />
</add>
<applicationPoolDefaults managedRuntimeVersion="v4.0">
<processModel identityType="ApplicationPoolIdentity" loadUserProfile="true" setProfileEnvironment="false" />
</applicationPoolDefaults>
</applicationPools>
與程序App_Data具有FinancialHub.mdf文件
我的SQL Server對象資源管理器我發佈的網站目錄,只有當我通過Visual Studio 2015運行我的網站時出現連接我認爲這將運行在IIS Express上。
我每次在這裏和那裏改變時都會收到這個錯誤,但我真的很確定爲什麼。或者我對web.config等進行了哪些更改會導致此錯誤。我也檢查Windows事件日誌。
我也跟着上處理這一問題這2個鏈接,
Using LocalDB with Full IIS, Part 1: User Profile,
Using LocalDB with Full IIS, Part 2: Instance Ownership
如果需要更多的信息,我可以提供..
我覺得我一直在圍繞布什試圖弄清楚但我似乎無法解決它..
我真的很感激任何幫助請。非常感謝。
請勿*上傳*圖片*的代碼。我們無法對此做任何事情,任何試圖幫助您的人都必須重新輸入所有內容。它把你的汽車照片給機修工並讓他們告訴你什麼是錯的。 – Siyual
Siyual你碰巧解決了我的問題嗎?感謝您的編輯@marc_s – domster