我正在使用Visual Studio 2010处理WPF应用程序Telerik.
每次我使用设计器时,我一直在处理很多崩溃:点击一个元素,改变它的位置,甚至改变它的名字都会导致崩溃,并显示以下异常:
System.ArgumentNullException
Value cannot be null.
to System.RuntimeType.MakeGenericType(Type[] instantiation)
to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.GetRuntimeType(Type type)
to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkType.TryGetRuntimeType()
to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkUtil.EnsureRuntimeType(Type type)
to Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkProvider.GetRuntimeType(Type reflectionType)
[...]
Run Code Online (Sandbox Code Playgroud)
我尝试了以下事项:
这些尝试都没有奏效.
今天早上,我注意到设计师根本没有崩溃,我明白了原因:设计师在我打开或编辑XAML时崩溃了.
打开XAML后,Visual Studio开始冻结,每次我尝试点击某些内容时设计器都会崩溃.如果我关闭Visual Studio并构建解决方案(不打开XAML),一切都可以正常使用设计器.
我的猜测是,当Visual Studio试图将XAML代码 "转换" 为设计器中的图形元素时,出现问题,并且仅在该方向上.
问题:你有没有尝试过这种事情?您是否知道为什么修改XAML会导致崩溃以及如何解决?
先感谢您.
ArgumentNullException是GetRuntimeTime.我已经能够看到.NET代码,但我无法确定问题的根源.请参阅下面的完整堆栈跟踪:
此外,这是发生错误的确切行和异常详细信息.请注意,该文件是VSIsolationProviderService.cs,并且我能够看到源代码,这要归功于.NET Reflector Object Browser.

Message=Value cannot be null.
Source=mscorlib
StackTrace:
to System.RuntimeType.MakeGenericType(Type[] instantiation)
InnerException: …Run Code Online (Sandbox Code Playgroud) 我正在使用x86_64 GNU/Linux与gcc.
大纲部分man -s2 open说:
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode);
Run Code Online (Sandbox Code Playgroud)
现在,当我尝试编译以下代码片段时,gcc不会抛出警告/错误.
#include <stdio.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int fd;
fd = open("foo.txt", O_RDWR, 0777);
if(fd == -1)
perror("open");
fd = creat("foo.txt", 0777);
if(fd == -1)
perror("creat");
close(fd);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
那么,types.h和stat.h可选的?他们在manpage中的目的是什么open()?
我对 Android 编程还很陌生,我遇到了一个简单的问题。
我有一个带有一些按钮和徽标的基本主页。我使用 aLinearLayout和layout_weight属性来分发所有组件。
这是我的代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="iut.project.findmeapp.MainActivity" >
<ImageView
android:id="@+id/activityMainAppLogoIv"
android:layout_width="match_parent"
android:layout_height="@dimen/null_height"
android:contentDescription="@string/description_logo"
android:layout_weight="1"
android:maxHeight="@dimen/img_maxHeight"
android:layout_margin="@dimen/img_margin"
android:src="@drawable/ic_launcher" />
<Button
android:id="@+id/activityMainMyEventsBtn"
android:layout_width="match_parent"
android:layout_height="@dimen/null_height"
android:layout_marginTop="@dimen/button_margin_vertical"
android:layout_marginBottom="@dimen/button_margin_vertical"
android:layout_weight="1"
android:text="@string/my_events" />
<Button
android:id="@+id/activityMainMyContactsBtn"
android:layout_width="match_parent"
android:layout_height="@dimen/null_height"
android:layout_marginTop="@dimen/button_margin_vertical"
android:layout_marginBottom="@dimen/button_margin_vertical"
android:layout_weight="1"
android:text="@string/my_contacts" />
<Button
android:id="@+id/activityMainLastNotifBtn"
android:layout_width="match_parent"
android:layout_height="@dimen/null_height"
android:layout_marginTop="@dimen/button_margin_vertical"
android:layout_marginBottom="@dimen/button_margin_vertical"
android:layout_weight="1"
android:text="@string/last_notification" />
<TextView
android:id="@+id/activityMainCopyrightTv"
android:layout_width="match_parent"
android:layout_height="@dimen/null_height"
android:gravity="center"
android:layout_weight="0.5"
android:layout_margin="@dimen/tw_margin"
android:text="@string/copyright" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
(注:@dimen/null_height是0dp)
我的问题是我希望图像随着屏幕的大小缩放,但我不希望它像素化:我设置的最大高度为200px。
以下几行似乎不起作用,因为图像没有限制并且完全忽略了该maxHeight属性。 …
我尝试用一些额外的方法和属性"包装"一个StreamReader类Fichier.
我想要两件事:
StreamReader在自动打开Fichier类;StreamReader当我们使用overrided方法打开ReadLine,而不是之前(我们需要有阅读它之前修改文件StreamReader).我的一段代码看起来像这样:
public string ReadLine()
{
if (Reader == null || ???)
{
Reader = new StreamReader(Path);
}
return Reader.ReadLine();
}
Run Code Online (Sandbox Code Playgroud)
在???,我想检查StreamReader是否已关闭.的确,如果我们这样做:
StreamReader sr = new StreamReader(path);
sr.Close();
Run Code Online (Sandbox Code Playgroud)
sr 不是null,但如何检查它是否已关闭,以及如何重新打开它?
如果你想知道我为什么需要打开和关闭StreamReader,那是因为Fichier对象需要随时存在,但是它所代表的文件需要在外部程序中多次修改.
我正在运行最新版本的Android Studio.
为了使用Google App Engine,我尝试按照这些简单的步骤操作.
我的问题是没有Google Cloud可见的模块类型,你可以看到:

你能帮助我吗 ?我不知道,网上没有任何东西帮助我.先感谢您.
google-app-engine android android-studio google-cloud-platform
我正在尝试一种让我发疯的行为.
我有一个ProgressBar代表数据库导入的进化(百分比,从)0到100.
导入完成后(ProgressBar.Value = 100.0),我打开一个日志窗口,其代码如下所示:
RadWindow window = new RadWindow()
{
//Set some properties
};
window.Closed += Log_Closed;
window.ShowDialog();
Run Code Online (Sandbox Code Playgroud)
在之后RadWindow被关闭,我想重置ProgressBar.如您所见,我使用Log_Closed代码如下的函数:
private void Log_Closed(object sender, EventArgs e)
{
//pbImport.Value = pbImport.Minimum; (didn't work)
pbImport.Value = 0;
}
Run Code Online (Sandbox Code Playgroud)
注意:pbImport是我的进度条.
该指令 Log_Closed 无效.
在指导之前:

经过指示:

显然,进度条未在UI中更新.我无法理解这一点.谢谢您的帮助.