在阅读标准.Net用户设置时,我们遇到了罕见的异常(这是VS 2008中"项目属性"中的设置):
System.Configuration.ConfigurationErrorsException was caught
Message="Configuration system failed to initialize"
Source="System.Configuration"
BareMessage="Configuration system failed to initialize"
Line=0
StackTrace:
at System.Configuration.ConfigurationManager.PrepareConfigSystem()
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
at System.Diagnostics.DiagnosticsConfiguration.Initialize()
at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize()
at System.Diagnostics.TraceInternal.InitializeSettings()
at System.Diagnostics.TraceInternal.get_Listeners()
InnerException: System.Configuration.ConfigurationErrorsException
Message="Unexpected end of file has occurred. The following elements are not closed: setting, SettingsTest.Properties.Settings, userSettings, configuration. Line 7, position 1. (C:\\Documents and Settings\\USER\\Local Settings\\Application Data\\Hitcents\\SettingsTest.vshost.exe_Url_ghwhc20utv4toanuinmj0pfsljthcugo\\1.0.0.0\\user.config line 7)"
Source="System.Configuration"
BareMessage="Unexpected end of file has occurred. The following elements are not closed: setting, SettingsTest.Properties.Settings, …Run Code Online (Sandbox Code Playgroud) 对于一些传统POS应用程序的互操作,我想知道是否有可能在C#中实现虚假的OPOS设备.
基本上我会实现一个虚假键盘,它接受Web请求并将按键传递给遗留应用程序.
有谁知道这是可能的还是在哪里获得文件?我认为OPOS刚刚调用了由注册表项配置的COM对象.所有这些都应该在C#中实现.
如果目录不存在,有没有办法安全地使用DirectoryCatalog来处理?
这是我的容器设置方式的代码示例:
//Create an assembly catalog of the assemblies with exports
var catalog = new AggregateCatalog(
new AssemblyCatalog(Assembly.GetExecutingAssembly()),
new AssemblyCatalog(Assembly.Load("My.Second.Assembly")),
new DirectoryCatalog("Plugins", "*.dll"));
//Create a composition container
var container = new CompositionContainer(catalog);
Run Code Online (Sandbox Code Playgroud)
但是如果目录不存在则抛出异常,我想忽略该错误.
我们有一位新的开发人员(精通Visual Studio)开始在Mac上使用MonoTouch.
我在MonoDevelop中设置(使用一段时间后)设置与Visual Studio完全相同:
有没有办法导出这些并导入另一台机器?我不介意手动复制文件.我正在使用MonoDevelop 2.8.6.4(现在应该是最新的非beta版).
如果这是可能的话,我也想把我的设置放在GitHub上.我知道很多.Netters会利用它.
我们正在制作一款游戏,在加载时渲染几个闪屏.
所以我们没有使用Default.png或Default@2x.png,因为启动时屏幕是空白的.
那么如何在iPhone 5模拟器中获得iOS 6以使我们的游戏全屏呈现而没有这里提到的闪屏图像?我们只需要考虑使用启动画面图像吗?这是唯一的方法吗?我认为应该有一些你可以打开的东西Info.plist.
我们仍然宁愿不使用启动画面图像,因为它会使我们的应用程序包更大 - 我们非常接近50MB.
现在我们的ASF集群正在运行:
我们正在尝试应用见解,我也喜欢他们的文档设置未处理的错误跟踪这里有我们的Web API项目.
问题是,我想要我们的Actor项目.
在Actor中是否存在捕获未处理错误的全局位置?我知道它是新的,也许这就是为什么我找不到这方面的文档.
现在我在每个actor方法中都这样做,但似乎不是一个很好的解决方案:
public async Task DoStuff()
{
try
{
//Do all my stuff
}
catch (Exception exc)
{
//Send to Windows Event Source
ActorEventSource.Current.ActorMessage(this, "Unhandled error in {0}: {1}", nameof(DoStuff), exc);
//Send to Application Insights
new TelemetryClient().TrackException(exc);
throw exc;
}
}
Run Code Online (Sandbox Code Playgroud) 我们有一个以编程方式映射网络驱动器的应用程序 在使用UAC的Vista上,我们遇到了一些奇怪的问题.
我们的应用程序将驱动器映射为非提升的,因此如果用户浏览资源管理器并双击以运行exe,则会提示输入UAC.因此,当他们批准它时,它会提示输入共享的用户名/密码...因为凭据已保存,所以很奇怪.
事实证明,提升的进程无法访问从非提升进程映射的映射驱动器.
要查看此问题,请执行以下步骤:
此时,您可以运行简单的"net use",并查看提升的cmd上的连接是不可用的,但另一个非提升的cmd将其视为OK.
有没有人知道解决此问题的解决方法?或者可能是一种将网络驱动器映射到"所有用户"的方法?
我创建了一个具有以下属性的自定义分层WPF窗口:
我在"项目属性" - >"应用程序"选项卡下添加了Icon.ico.
如果ShowInTaskBar为false,则图标显示为默认WPF窗口图标,但如果ShowInTaskbar为true,则显示正确.
我们希望图标能够在Alt + Tab菜单中正确显示.我们如何实现这一点并使ShowInTaskbar = False?
我们有一个近乎完整的应用程序,并试图挤压谷歌播放的50MB下载限制.
当检查我们的APK来想方设法砸我们的文件大小,我注意到了lib\x86,lib\armeabi和lib\armeabi-v7a目录,描述在这里.它们对应于Mono for Android项目的项目选项中的"支持的体系结构"选项.
如果我删除x86,我会在APK大小上节省大约1.1 MB.(这几乎足以让我们低于50MB)
我在Windows Phone 7中创建了一个值转换器...
public class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// ...
}
// ...
}
Run Code Online (Sandbox Code Playgroud)
......并像这样使用它......
<TextBlock Text="{Binding SomeField, Converter={StaticResource MyConverter}, ConverterParameter=SomeParameter}" <!-- ... --> />
Run Code Online (Sandbox Code Playgroud)
我的问题:argumentConvert方法的文化总是"en-US",即使我改变Windows Phone设备(或模拟器)的文化对德国德国说,这个culture论点仍然是英语.
c# ×8
.net ×5
xamarin.ios ×2
android ×1
com ×1
cultureinfo ×1
favicon ×1
file-sharing ×1
icons ×1
ios ×1
ios6 ×1
iphone-5 ×1
macos ×1
mef ×1
mono ×1
monodevelop ×1
net-use ×1
objective-c ×1
opos ×1
settings ×1
uac ×1
windows ×1
wpf ×1
xamarin ×1