我无法找到有关我的问题的任何信息.如果我的搜索工作不够好,无法找到答案,请原谅.我只是想避免旋转我的车轮.
谢谢!
跟进:如果没有覆盖,我该怎么办?(如果可能的话)?
一些背景:我有一个项目,它从我的解决方案中的其他项目收集所有诊断(跟踪源)信息.我需要一种方法来获取主项目名称,以便我可以为转储文件提供正确的唯一名称.
问题:在我遇到这篇博客文章之前,我找不到关于如何获取启动项目的程序集名称的明确答案:http://weblog.west-wind.com/posts/2009/Jun/09/Getting -the-应用程序-启动-装配式,WPF设计器
我遇到了一些语法问题.我对界面并不熟悉,请原谅我的无知.
VS2010给我一个错误... application.Name = System.AppDomain.CurrentDomain.FriendlyName;
public static void AddApplication(string applicationName = null, string processImageFileName = null)
{
INetFwAuthorizedApplications applications;
INetFwAuthorizedApplication application;
if(applicationName == null)
{
application.Name = System.AppDomain.CurrentDomain.FriendlyName;/*set the name of the application */
}
else
{
application.Name = applicationName;/*set the name of the application */
}
if (processImageFileName == null)
{
application.ProcessImageFileName = System.Reflection.Assembly.GetExecutingAssembly().Location; /* set this property to the location of the executable file of the application*/
}
else
{
application.ProcessImageFileName = processImageFileName; /* set this property to …Run Code Online (Sandbox Code Playgroud) 我在添加对项目的引用时遇到问题.我需要System.Web引用以使我的代码工作,但引用不会坚持.当我查看解决方案资源管理器时,我在添加的引用顶部找到了此警报图标.我在同一解决方案中的另一个项目中有相同的参考,它工作正常.

如果查看此引用的属性,您将看到该Resolved属性设置为False

有谁知道我如何解决这个或导致这个问题的原因?
所以我试图对此很聪明,但看起来这个想法是非常愚蠢的,因为我正在获得一个堆栈溢出异常.
理想情况下,CheckInternetStatus每当我使用IsConnected旗帜时,我都希望能够运行.
我怎样才能正确完成这个?或者这根本不是一个好主意?
public static class Internet
{
public static bool IsConnected
{
get
{
CheckInternetStatus();
return IsConnected;
}
set
{
IsConnected = value;
}
}
}
Run Code Online (Sandbox Code Playgroud)
附加信息:CheckInternetStatus更新IsConnected
我试图使用select子句从数据库查询中挑选一个与指定名称字段匹配的对象,如下所示:
objectQuery = from obj in objectList
where obj.Equals(objectName)
select obj;
Run Code Online (Sandbox Code Playgroud)
在我的查询的结果视图中,我得到:
base {System.SystemException} = {"Boolean Equals(System.Object)"}
在那里我应该期待有点像Car,Make或Model
有人请解释我在这里做错了什么吗?
有问题的方法可以在这里看到:
// this function searches the database's table for a single object that matches the 'Name' property with 'objectName'
public static T Read<T>(string objectName) where T : IEquatable<T>
{
using (ISession session = NHibernateHelper.OpenSession())
{
IQueryable<T> objectList = session.Query<T>(); // pull (query) all the objects from the table in the database
int count = objectList.Count(); // …Run Code Online (Sandbox Code Playgroud) c# ×6
asynchronous ×1
database ×1
dll ×1
get ×1
interface ×1
iqueryable ×1
null ×1
reference ×1
reflection ×1
select ×1
set ×1
sql ×1