我想创建3个AppSettings配置文件:
在我的App.config中添加后:
<appSettings file="Database.config" />
<appSettings file="Messages.config" />
<appSettings file="Global.config" />
Run Code Online (Sandbox Code Playgroud)
但是当我尝试访问三个文件中的一个中的密钥时ConfigurationManager
,我收到以下错误:
配置系统无法初始化.每个配置文件只能出现一次.
我不能有多个AppSettings配置文件?
我在其他三台服务器上使用相同的Web应用程序.任何人都知道为什么不在第四台服务器上工作?查看错误和堆栈跟踪:
发生了操作错误.
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:
System.DirectoryServices.DirectoryServicesCOMException:发生操作错误.来源错误:
在执行当前Web请求期间生成了未处理的异常.可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息.
堆栈跟踪:
[DirectoryServicesCOMException(0x80072020):发生操作错误.] System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)+454 System.DirectoryServices.DirectoryEntry.Bind()+36 System.DirectoryServices.DirectoryEntry.get_AdsObject()+31 System.DirectoryServices.PropertyValueCollection.PopulateList()+22
System.DirectoryServices .PropertyValueCollection..ctor(DirectoryEntry entry,String propertyName)+96
System.DirectoryServices.PropertyCollection.get_Item(String propertyName)+142 System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer()+1134 System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit( )+37 System.DirectoryServices.AccountManagement.PrincipalContext.Initialize()+124 System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx()+31 System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context,Type principalType,Nullable'1 identityType, String identityValue,DateTime refDate)+14
System.DirectoryServices.AccountMan agement.Principal.FindByIdentityWithType(PrincipalContext context,Type principalType,String identityValue)+73
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context,String identityValue)+25
Infraero.TINE3.STTEnterprise.Web.Common.Seguranca.ServicoAutenticacao.EfetuarLogin (AcessoUsuario acessoUsuario,String senha)在D:\ SVN\STT\trunk\4-0_CodigoFonte_Enterprise\4-4_SRC\Infraero.TINE3.STTEnterprise.Web\Common\Seguranca\ServicoAutenticacao.cs:34 Infraero.TINE3.STTEnterprise.Web. Controllers.LoginController.ValidarUsuarioAD(String matricula,String senha,AcessoUsuario acessoUsuario)在D:\ SVN\STT\trunk\4-0_CodigoFonte_Enterprise\4-4_SRC\Infraero.TINE3.STTEnterprise.Web\Controllers\LoginController.cs:92 Infraero. TINE3.STTEnterprise.Web.Controllers.LoginController.ValidarUsuario(String matricula,String senha)在D:\ SVN\STT\trunk\4-0_CodigoFonte_Enterprise\4-4_SRC\Infraero.TINE3.STTEnterprise.Web\Controllers\LoginController.cs: 80 Infraero.TINE3.D:\ SVN\STT\trunk\4-0_CodigoFonte_Enterprise\4-4_SRC\Infraero.TINE3.STTEnterprise.Web\Controllers\LoginController.cs中的STTEnterprise.Web.Controllers.LoginController.Index(LoginViewModel loginViewModel):54 lambda_method(Closure, ControllerBase,Object [])+ 108
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller,Object [] parameters)+17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext,IDictionary'2 parameters)+208
System. Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext,ActionDescriptor actionDescriptor,IDictionary'2 parameters)+27
System.Web.Mvc.<> c__DisplayClass15.b__12()+55 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter,ActionExecutingContext …
我有一个asp.net mvc 3站点,我在iis 7.5(框架4.0)中发布它,问题是css和脚本无法使用网站中的用户登录.所以:
Web配置包含:
<location path="Content" allowOverride="true">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="Scripts" allowOverride="true">
<system.web>
<authorization>
<allow users="*" />
</authorization>
<globalization culture="pt-BR" uiCulture="pt-BR" />
</system.web>
</location>
<authorization>
<deny users="?"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
Obs:我在bin目录中添加的dll:System.Web.Helpers.dll,System.Web.Mvc.dll,System.Web.Routing.dll,System.Web.WebPages.dll.
我试图将局部中的路径更改为"〜/ Content",但我得到了相同的结果.
我试图将标签允许放在autorization标签中:
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
Run Code Online (Sandbox Code Playgroud)
但我得到了同样的结果.
我错过了什么?
我在以下路径中有一个.aspx页面:
Areas/Management/Views/Ticket/Report.aspx
Run Code Online (Sandbox Code Playgroud)
我想在浏览器中将其路由到以下路径:
http://localhost/Reports/Tickets
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?
我试试这个:
routes.MapRoute(
"Tickets", // Route name
"Areas/Management/Views/Ticket/Report.aspx", // Original URL
new { controller = "Reports", action = "Tickets" } // New URL
);
Run Code Online (Sandbox Code Playgroud)
但我得到了404
错误.
我做错了什么?
Obs:我把它放在Default
路线之前.
我需要在第一次调用wcf服务之前运行一些方法,我在哪里放这些方法?WCF服务的启动方法在哪里?
Obs1:我的WCF服务将在IIS6上运行.Obs2:我正在使用.net framework 4.0.
我正在尝试运行一个简单的WCF服务......
我的Wcf服务.config:
<system.serviceModel>
<services>
<service name ="WebService.Receptor">
<endpoint
address = "http://MyServer:8000/WS"
binding = "wsHttpBinding"
contract = "IMyContract"
/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
Run Code Online (Sandbox Code Playgroud)
我的Windows服务.config:
<system.serviceModel>
<client>
<endpoint
name = "Receptor"
address = "http://MyServer:8000/WS"
binding = "wsHttpBinding"
contract = "IMyContract"
/>
</client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)
Obs:Wcf服务在Windows 7上的IIS 7.5下运行.
所以,当我尝试从wcf代理(IMyContract)调用方法时,我收到此错误:
在http:// MyServer:8000/WS上没有可以接受该消息的端点.这通常是由错误的地址或SOAP操作引起的.有关更多详细信息,请参阅InnerException(如果存在).
内在的例外:
{"无法连接到远程服务器"}
谁知道为什么?
我正在使用log4net 1.2.11.因此,日志记录在开发人员计算机中工作,但是当我在测试服务器中发布时,它无法正常工作.远程调试,我看到日志在ILog变量中正确加载,但是当它调用log.Error()时,没有任何反应,没有日志文件,没有log4net异常.
任何想法?
Obs:我在asp.net mvc 3网站上使用log4net.
- 编辑
我把完全控制权交给每个人......没有任何改变,没有日志文件.
我有三个响应项(imgs),但每次加载Owl-Carousel时,owl-wrapper宽度是所有图像大小的两倍.例如; 如果图像全尺寸需要1583像素,猫头鹰包装需要1583*3*2 = 9498px,所有网站都采用这个宽度,而不是全尺寸(1583像素).
问题:http: //nacionalempreendimen.web2144.uni5.net
HTML
<div id="promoted-carousel">
<div class="item"><img src="assets/img/tmp/1.jpg"></div>
<div class="item"><img src="assets/img/tmp/2.jpg"></div>
<div class="item"><img src="assets/img/tmp/3.jpg"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
#promoted-carousel .item img{
display: block;
width: 100%;
height: auto;
}
Run Code Online (Sandbox Code Playgroud)
JS
$('#promoted-carousel').owlCarousel({
autoPlay: 5000,
stopOnHover: true,
singleItem: true
});
Run Code Online (Sandbox Code Playgroud)
UPDATE
我看到当我把#promoted-carousel
div放出.page-wrapper
div时,它运行正常.但是我对css的了解还不足以理解它的工作原理.
我有一个资源(.resx)文件,它目前有58个字符串属性.这个字符串属性的数量可以增长..
我怀疑的是,这些字符串是否记在内存中?如果我有200,将全部留在记忆中吗?或者字符串保存在文件中,ResourceManager访问文件?还是其他什么?这怎么工作?
我正在尝试在我的asp.net mvc项目中路由.aspx(webforms页面).我在global.asax中注册页面:
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapPageRoute("Tickets", "Reports/Tickets", "~/WebForms/Reports/Tickets.aspx");
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });
Run Code Online (Sandbox Code Playgroud)
问题是,在我添加第二行之后,站点停止进入我的Home Controller(索引操作)并重定向到:http://localhost:37538/Reports/Tickets?action=Index&controller=Login%22
始终我运行项目.
项目详情:
Obs:要重现此错误,请在创建文件夹中的Tickets
webforms页面后,创建一个新的asp.net mvc项目作为Internet应用程序/WebForms/Reports
,并注册新路由.运行项目(可能你已经记录),所以现在注销,你将被重定向到http://localhost:35874/Reports/Tickets?action=LogOff&controller=Account
,为什么呢?
.net ×5
asp.net-mvc ×4
c# ×4
iis ×3
routing ×3
wcf ×2
appsettings ×1
asp.net ×1
css ×1
html ×1
javascript ×1
jquery ×1
log4net ×1
owl-carousel ×1
resources ×1
resx ×1
web-config ×1
webforms ×1