我有一个像这样的网络项目:namespaceWeb{publicpartialclass_Default:System.Web.UI.Page{protectedvoidPage_Load(objectsender,EventArgse){lbResult.Text=PathTest.GetBasePath();}}}PathTest.GetBasePath()方法在另一个项目中定义如下:namespaceTestProject{publicclassPathTest{publicstaticstringGetBasePath(){returnAppDomain.CurrentDoma
我有一个Bootstrapper,它查看ASP.NETMVC应用程序中的所有程序集以查找实现IBootstrapperTask接口(interface)的类型,然后将它们注册到IOCContrainer。这个想法是您可以直接将IBootstrapperTasks放在任何地方,并按照您喜欢的方式组织您的项目。Bootstrap代码:publicclassBootstrapper{staticBootstrapper(){TypebootStrapperType=typeof(IBootstrapperTask);IListassemblies=AppDomain.CurrentDomai
我在同一文件夹中有两个exe文件,我可以通过exe1中的按钮运行exe2。今天我通过远程(终端服务)session观察客户,exe2无法运行“未找到文件”错误,但我们检查时exe1位于同一目录中。所以我应该使用AppDomain.CurrentDomain.BaseDirectory或System.Environment.CurrentDirectory?谢谢 最佳答案 如果您想在与您的应用程序相同的目录中查找文件,AppDomain.CurrentDomain.BaseDirectory是正确的选择。Environment.Cur