質問

私はCSLAと分散環境でMVC .NETを使用していると私は、私のWeb層(例えばWebsite.MVC)のいずれかからを参照HttpPostedFileBaseことができますが、私は にすることはできません別の層からの基準HttpPostedFileBaseは(OtherLayer.Webそれを呼び出すことができます)。

私はHttpPostedFileBaseを呼び出すことができるように何をする必要があるか上の任意のアイデア? 私は代わりにこれを使用する必要があります。

- 私は両方の層にHttpPostedFileを使用することができています?

アセンブリ参照は、基本的に同じである - Website.MVCに私が持っています:

namespace Website.Mvc.Controllers
{
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.Web.Mvc;
  using System.Web;
  using System.IO;
  using PetOrganizer.Mvc.Helpers;
  using TrupanionPetInsurance.Web;

私は持っている私の他の層でのに対します:

namespace OtherLayer.Web
{
  using System;
  using System.Collections;
  using System.Collections.Generic;
  using System.Collections.Specialized;
  using System.Data;
  using System.Data.SqlClient;
  using System.IO;
  using System.Net.Mail;
  using System.Text;
  using System.Text.RegularExpressions; 
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Security;
  using System.Xml;
  using System.Xml.Serialization;
  using Csla;
  using iTextSharp.text;
  using iTextSharp.text.pdf;
  using TruDat.BusinessLayer;
  using TruDat.BusinessLayer.Billing;
  using TruDat.BusinessLayer.Data;
  using TruDat.BusinessLayer.Utility;
  using TrupanionPetInsurance.Web.EmailTemplateParser;
  using TruDat.BusinessLayer.DataServices;

他のヒント

  

あなたのプロジェクトがHttpPostedFileBaseタイプが含まれているSystem.Web.Abstractionsアセンブリを参照することを確認します。

おかげで、アンドリュー・トリックをしたウサギ、まだ私は、.NET 4.0からというように、System.Web.Abstractionsが廃止されていることを信じて、あなたが代わりのSystem.Webへの参照を追加する必要があります。

私の場合は、それがその後、最終的な解決策だった。

using System.Web;

働いていたため、HttpPostedFileBaseが認められた。

感謝します。

scroll top