操作可能会破坏运行时的稳定性

时间:2013-10-12 12:19:40

标签: c#-4.0 structuremap

System.Security.VerificationException:操作可能会破坏运行时的稳定性。 .... 我的网站:http://noyaban.com/tara

IoC.cs:

public static IContainer Initialize()
    {
        ObjectFactory.Initialize(x =>
        {
            x.Scan(scan =>
            {
               // scan.AssembliesFromApplicationBaseDirectory();
                scan.TheCallingAssembly();
                scan.WithDefaultConventions();
            });
            x.For<IUnitOfWork>().HttpContextScoped().Use<SadeghianDbContext>();
            x.For<IAboutUsService>().Use<AboutUsService>();
            x.For<IBannersService>().Use<BannersService>();
            x.For<ICentralOfficeService>().Use<CentralOfficeService>();
            x.For<IContactUsService>().Use<ContactUsService>();
            x.For<IDownloadsService>().Use<DownloadsService>();
            x.For<ILogoService>().Use<LogoService>();
            x.For<INewsService>().Use<NewsService>();
            x.For<IProductsService>().Use<ProductsService>();
            x.For<IResellerService>().Use<ResellerService>();
            x.For<ISlideShowService>().Use<SlideShowService>();
            x.For<IUsersService>().Use<UsersService>();
            x.For<IProvinceService>().Use<ProvinceService>();
            x.For<IForgottenPasswordService>().Use<ForgottenPasswordService>();
            x.For<IAdminCommentsService>().Use<AdminCommentsService>();
            x.For<IGroupingProductService>().Use<GroupingProductService>();
            x.For<IHomePageBannerService>().Use<HomePageBannerService>();
            x.For<IHomePageFooterService>().Use<HomePageFooterService>();
        });
        return ObjectFactory.Container;
    }

本地主机中的此代码完美无缺,但主机无法正常工作!

stack trace

1 个答案:

答案 0 :(得分:0)

enter image description here

我建议中等信任 我认为这可能与中等信任问题有关