「HOD」と「Controllers」の2つのプロジェクトがあります。Controllersは、名前空間が「Controllers」のクラスライブラリです。HODのコードファイルで、「Controllersを使用して」Controllers名前空間を参照しようとしています。HODプロジェクトの参照をControllersに追加しましたが、VS2008のreferencesフォルダーに表示されます。
プロジェクトをビルドするとエラーは発生しませんが、ページを表示すると「タイプまたは名前空間名「Controllers」が見つかりませんでした(usingディレクティブまたはアセンブリ参照がありませんか?)」というエラーが表示されます。 。
Controllers.cs(クラスライブラリ、Controllersプロジェクト)
using System;
using System.Collections.Generic;
using System.Text;
namespace Controllers
{
public class Controller { }
}
index.aspx.cs(HODプロジェクト)
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Controllers;
public partial class HOD : Page
{
string sop() { return "sop"; }
protected void Page_Load(object sender, EventArgs e)
{
blahmsg.Text = sop();
}
}
プロジェクトはWebサーバーにあり、Controllers.dllはHOD.dllと同じbinフォルダーにあります。よろしくお願いします!
編集:.slnの内容
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "T:", "T:\", "{1D5F28B3-E6A0-4CF8-B7A3-43121225C73E}"
ProjectSection(WebsiteProperties) = preProject
TargetFramework = "2.0"
Debug.AspNetCompiler.VirtualPath = "/T:"
Debug.AspNetCompiler.PhysicalPath = "T:\"
Debug.AspNetCompiler.TargetPath = "E:\DEV\webdev\webdev\PrecompiledWeb\T:\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/T:"
Release.AspNetCompiler.PhysicalPath = "T:\"
Release.AspNetCompiler.TargetPath = "E:\DEV\webdev\webdev\PrecompiledWeb\T:\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "53327"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HOD", "Y:\HOD\HOD.csproj", "{5F523FB7-B902-4E6E-BAA9-C2EB37D69EC7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Controllers", "Y:\HOD\Controllers\Controllers.csproj", "{E6A16990-5FC6-4FE3-8DAB-CD2FEC8CF4FF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C8A12BBE-4483-4560-97A4-795F2E57D667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8A12BBE-4483-4560-97A4-795F2E57D667}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8A12BBE-4483-4560-97A4-795F2E57D667}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{C8A12BBE-4483-4560-97A4-795F2E57D667}.Release|Any CPU.Build.0 = Debug|Any CPU
{A81C381B-1E12-49B0-8BC0-8532EF9F216F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A81C381B-1E12-49B0-8BC0-8532EF9F216F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A81C381B-1E12-49B0-8BC0-8532EF9F216F}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{A81C381B-1E12-49B0-8BC0-8532EF9F216F}.Release|Any CPU.Build.0 = Debug|Any CPU
{BD46969E-9D1C-419A-A82C-388E35BF7C13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD46969E-9D1C-419A-A82C-388E35BF7C13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD46969E-9D1C-419A-A82C-388E35BF7C13}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{BD46969E-9D1C-419A-A82C-388E35BF7C13}.Release|Any CPU.Build.0 = Debug|Any CPU
{1D5F28B3-E6A0-4CF8-B7A3-43121225C73E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D5F28B3-E6A0-4CF8-B7A3-43121225C73E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D5F28B3-E6A0-4CF8-B7A3-43121225C73E}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{1D5F28B3-E6A0-4CF8-B7A3-43121225C73E}.Release|Any CPU.Build.0 = Debug|Any CPU
{5F523FB7-B902-4E6E-BAA9-C2EB37D69EC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F523FB7-B902-4E6E-BAA9-C2EB37D69EC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F523FB7-B902-4E6E-BAA9-C2EB37D69EC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F523FB7-B902-4E6E-BAA9-C2EB37D69EC7}.Release|Any CPU.Build.0 = Release|Any CPU
{E6A16990-5FC6-4FE3-8DAB-CD2FEC8CF4FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6A16990-5FC6-4FE3-8DAB-CD2FEC8CF4FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6A16990-5FC6-4FE3-8DAB-CD2FEC8CF4FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6A16990-5FC6-4FE3-8DAB-CD2FEC8CF4FF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
コンパイラ出力
------再構築すべて開始:プロジェクト:コントローラー、構成:任意のCPUのデバッグ------ C:\ Windows \ Microsoft.NET \ Framework \ v3.5 \ Csc.exe / noconfig / nowarn:1701、 1702 / errorreport:prompt / warn:4 / define:DEBUG; TRACE / reference: "C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Core.dll" / reference: "C :\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Data.DataSetExtensions.dll "/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll / reference: "C: \ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Xml.Linq.dll "/ debug + / debug:full / filealign:512 / optimize- / out:obj \ Debug \ Controllers.dll /目標:ライブラリClass1.csProperties\ AssemblyInfo.cs
コンパイルが完了しました-0エラー、0警告コントローラー-> Y:\ HOD2 \ Controllers \ bin \ Debug \ Controllers.dll ------再構築すべて開始:プロジェクト:HOD、構成:任意のCPUのデバッグ----- --C:\ Windows \ Microsoft.NET \ Framework \ v3.5 \ Csc.exe / noconfig / nowarn:1701,1702 / errorreport:prompt / warn:4 / define:DEBUG; TRACE / reference:Y:\ HOD2 \ Controllers \ bin \ Debug \ Controllers.dll / reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Configuration.dll / reference: "C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Core.dll "/ reference:" C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Data.DataSetExtensions.dll "/ reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Data.dll / reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.dll / reference:C:\ Windows\Microsoft。NET \ Framework \ v2.0.50727 \ System.Drawing.dll / reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.EnterpriseServices.dll / reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Web.dll / reference: "C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Web.Extensions.Design.dll" / reference: "C:\プログラムファイル(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Web.Extensions.dll "/reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Mobile.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Web.Services.dll / reference:C:\ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ System.Xml.dll / reference :"C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework \ v3.5 \ System.Xml.Linq.dll" / debug + / debug:full /optimize-/out:obj\Debug\HOD.dll /目標:ライブラリindex.aspx.csindex.aspx.designer.csProperties \ AssemblyInfo.cs
コンパイル完了-0エラー、0警告HOD-> Y:\ HOD2 \ bin \ HOD.dll ==========すべて再構築:2成功、0失敗、0スキップ======= ===