.Net FrameworkをIISで動かそうとすると404エラーが発生する リンクを取得 Facebook × Pinterest メール 他のアプリ - 8月 01, 2020 理由が全然わからなかったが、このサイト(WCF サービスで HTTP 404.17 エラー)を見つけてやっと解決したのでメモしておく。Windows10環境では以下のように「Windowsの機能の有効化」で「HTTPアクティブ化」にチェックを入れる。これでOK。 リンクを取得 Facebook × Pinterest メール 他のアプリ コメント
ソリューション構成ごとにconfigファイルを作成する - 7月 25, 2020 .NetFrameworkのソリューション構成ごとにweb.configを作成し、そのconfigファイルの内容を反映させる。 ちょっと、つまずいたのでメモしておく。 (アクション) 1. 新しいソリューション構成を作成する。 2. web.configを作成する。 3. 変換構文の作成 4. .csprojファイルの編集 1. 新しいソリューション構成の作成 Visual Studioの「ビルド」→「構成マネージャー」→「アクティブソリューション構成」→「新規作成」 で、新しいソリューション構成を作成する。 2. web.configの作成 Web.configを右クリックして「Config変換を追加」をクリックすると、先ほど追加した新しいソリューション構成のWeb.configが追加される。 3. 変換構文の作成 前回のブログ を参考に作成する。 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=192.168.44.10.1\SQLEXPRESS;Initial Catalog=AWS_DB;;Connect Timeout=60;Persist Security Info=False; User ID=hoge;Password=1234" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> </connectionStrings> <appSettings> ... 続きを読む
web.configにNlog設定を踏襲し、変換構文を使ってソリューション構成ごとに異なるログ設定をする - 7月 26, 2020 アクション 最初に以下を宣言する。 これで、ソースコードにはログを貼るだけでよくなる。 <configSections> <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> </configSections> あとは、targetとruleを付けるだけ。 全体像は以下の通り。 Web.config <configuration> <configSections> <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/> </configSections> <nlog> <targets> <target name="logFile" type="File" fileName="./logs/${shortdate}-debug.log" encoding="UTF-8" archiveFileName="${basedir}/logs/archives/archive.${shortdate}-debug.log" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="365" layout="${longdate},${uppercase:${level}},${callsite},${callsite-linenumber},${message}"/> <!-- <target name=... 続きを読む
C++の古いプロジェクトのビルドでerror MIDL2311 : statements outside library block are illegal in mktyplib compatability mode - 10月 31, 2020 IDEはVS2019。 ビルドすると、 error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode が発生する。 (対応方法) ***.vcxprojファイル内の <MkTypLibCompatible>true</MkTypLibCompatible> を全て <MkTypLibCompatible>false</MkTypLibCompatible> にする。 参考 Error MIDL2311 : statements outside library block are illegal in mktyplib compatability mode 続きを読む
コメント
コメントを投稿