2012-03-19 3 views
0

を私は今、このエラーを取得しています「このプリコンパイルされたサイトを更新可能にする」チェックボックスをオンにしてWebサイトを公開してください。のVisual Studio 2010にアップグレードした後 - いつでも私たちは最近、2010年</p> <p>のVisual Studioに当社のウェブサイトのプロジェクトをアップグレードする型または名前空間名「xxxxxxxxx_ascx」の名前空間に存在しない「ASP」

以前はVisual Studio 2008を使用していたので、なぜ今は動作しないのか分かりません。

The type or namespace name 'xxxxxxxxx_ascx' does not exist in the namespace 'ASP' 
(are you  missing an assembly reference?) 

エラーを引き起こす行はすべてこのようなことをしています。

ASP.content_Controls_Info_ascx infoControl = new ASP.content_Controls_Info_ascx(); 
infoControl.Stages = query.ToList(); 
PlaceHolder1.Controls.Add(infoControl); 

ドットネットフレームワークはまだ3.5

サイトは罰金のビルドとせずに作品を公開しているので、私は何かをアップグレードしていない確認し、「このプリコンパイルされたサイトが更新可能であることを許可します」。コードのcontent_Controls_Info_ascx部分もクラス名を強調表示しているので、それを探しています。

答えて

3

.slnあなたのWebサイトプロジェクトに関連するセクションを見つける。

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "YourWebProject", "..\WEB\YourWebProject", "{A3774FE1-AA19-4A0F-94C9-FA58084B2429}" 
    ProjectSection(WebsiteProperties) = preProject 
     TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 
     ProjectReferences = "..." 
     Debug.AspNetCompiler.VirtualPath = "/YourWebProject" 
     Debug.AspNetCompiler.PhysicalPath = "..\WEB\YourWebProject\" 
     Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\YourWebProject\" 
     Debug.AspNetCompiler.Updateable = "true" 
     Debug.AspNetCompiler.ForceOverwrite = "true" 
     Debug.AspNetCompiler.FixedNames = "false" 
     Debug.AspNetCompiler.Debug = "True" 
     Release.AspNetCompiler.VirtualPath = "/YourWebProject" 
     Release.AspNetCompiler.PhysicalPath = "..\WEB\YourWebProject\" 
     Release.AspNetCompiler.TargetPath = "PrecompiledWeb\YourWebProject\" 
     Release.AspNetCompiler.Updateable = "true" 
     Release.AspNetCompiler.ForceOverwrite = "true" 
     Release.AspNetCompiler.FixedNames = "false" 
     Release.AspNetCompiler.Debug = "False" 
     VWDPort = "2487" 
    EndProjectSection 
EndProject 

と "" にプロパティを次のように設定し(私はの.slnファイルを編集するために、メモ帳を使用):

  • Debug.AspNetCompiler.Updateable = "" それはこのようになります
  • Release.AspNetCompiler.Updateable = ""
デフォルトでは3210

は、それらがに設定された「」とエラーが発生しました:

型または名前空間名「xxxxxxxxx_ascx」名前空間に存在しない「ASP」 は(あなたは、アセンブリ参照が不足していますか? )

この解決策は私を助けました。

1

これはウェブサイトテンプレートに関する既知の問題です。これに対する解決策は、Webアプリケーションプロジェクトに変換することです。さらに詳しい情報:

http://codersbarn.com/post/2008/06/01/ASPNET-Web-Site-versus-Web-Application-Project.aspx

http://www.west-wind.com/weblog/posts/2005/Sep/12/Understanding-Page-Inheritance-in-ASPNET-20

あなたは場合には、あなたの参照をチェックすることができ何が起こっているかですが、ウェブサイトのテンプレートを使用すると、特にユーザーコントロールおよび外部のプロジェクト/ライブラリと再びこの問題に遭遇する可能性があること。

関連する問題