2

Local Environment { IIS 7.5 | Windows 7 | ASP.NET 4.0 | Integrated Pipeline}

Production Environment {IIS 8.0 | Windows 2012 Server | ASP.NET 4.x | Integrated Pipeline}

WEBAPI機能はローカル環境で機能します。

http://<domain>/api/towncity?startsWith=Marston

しかし、本番環境では、次の「鈍い」エラーメッセージが表示されました。

{"Message":"An error has occurred.","ExceptionMessage":"The system cannot find the file specified","ExceptionType":"System.ComponentModel.Win32Exception","StackTrace":null}

エラー情報を改善する方法はありますか?またはあなたは解決策を知っていますか?

どうもありがとう、デイブ。

4

1 に答える 1

1

調査の結果、公開されたRELEASE web.configは、WEB.CONFIGエンティティの接続文字列を更新しませんでした。

したがって、エンティティ接続文字列のローカル設定を使用していました。

 <add name="YourDatabaseNameEntities"
     connectionString="
          metadata=res://*/Model.YourDatabaseName.csdl|res://*/Model.YourDatabaseName.ssdl|res://*/Model.YourDatabaseName.msl;
          provider=System.Data.SqlClient;
          provider connection string=&quot;
              data source=<set datasource here>;
              initial catalog=<set catalog here>;
              persist security info=True;
              user id=<set user id here>;
              password=<set password here>;
              integrated security=False;
              MultipleActiveResultSets=True;
              App=EntityFramework&quot;
     "
     providerName="System.Data.EntityClient" />

私は現在、DEBUG、RELEASE、およびPRODUCTION用にさまざまなweb.configsを設定することに関するScottHanselmanの記事を見ています。

小さな幸せな機能

于 2013-03-04T17:35:52.337 に答える