vc2010 c# Program.cs steam错误代码0118 CS0118: "Form1"是"命名空间",但此处被当做"类型"来使用

没有更多推荐了,
不良信息举报
举报内容:
(c#)AutoCAD二次开发,[CommandMethod(&XXXXX&)]未能找到类型或命名空间名
举报原因:
原文地址:
原因补充:
最多只允许输入30个字
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!I've written a very simple class in C#:
class DisposableClass : IDisposable {
public void Dispose() { }
static void UsingClass() {
// line 31
using (var dc = new DisposableClass()) {
// line 32
DoSomething(dc);
// line 33
// line 34
// line 35
I've dumped the native code after JIT with WinDBG for it:
0:000& !u d30120
Normal JIT generated code
SimpleConsole.Program.UsingClass()
Begin d30120, size 80
c:\projects\SimpleConsole\SimpleConsole\Program.cs @ 32:
&&& 000007fe`87d30120 55
000007fe`87dec30
000007fe`87dc2420
rbp,[rsp+20h]
000007fe`87d00
qword ptr [rbp],rsp
000007fe`87d mov
qword ptr [rbp+8],0
000007fe`87dd6b47eeff
rcx,[000007fe`87c148a8]
000007fe`87d3013d e8fe24665f
clr+0xfe`e7392640) (JitHelp: CORINFO_HELP_NEWSFAST) // new DisposableClass()
000007fe`87d08
qword ptr [rbp+8],rax
c:\projects\SimpleConsole\SimpleConsole\Program.cs @ 33:
000007fe`87dd08
rcx,qword ptr [rbp+8]
000007fe`87d3014a e8d1beeeff
000007fe`87c1c020 (SimpleConsole.Program.DoSomething(System.Object), mdToken: 0012)
000007fe`87d3014f 90
000007fe`87d30150 90
c:\projects\SimpleConsole\SimpleConsole\Program.cs @ 35:
000007fe`87dd08
rcx,qword ptr [rbp+8]
000007fe`87dd1dc4feeeff
r11,[000007fe`87c20020]
000007fe`87d3015c ff15befeeeff
qword ptr [000007fe`87c20020] // Call Dispose()
000007fe`87d30162 90
000007fe`87d10
rsp,[rbp+10h]
000007fe`87d30167 5d
000007fe`87d30168 c3
// I could understand the code above (without exception thrown).
c:\projects\SimpleConsole\SimpleConsole\Program.cs @ 32:
000007fe`87d30169 55
000007fe`87dec30
000007fe`87d20
rbp,qword ptr [rcx+20h]
000007fe`87dc2420
qword ptr [rsp+20h],rbp
000007fe`87dd20
rbp,[rbp+20h]
c:\projects\SimpleConsole\SimpleConsole\Program.cs @ 35:
000007fe`87dd0800
qword ptr [rbp+8],0
000007fe`87d
000007fe`87d30199
000007fe`87d97feeeff
rdx,[000007fe`87c20020]
000007fe`87d08
rax,qword ptr [rbp+8]
000007fe`87d
byte ptr [rax],0
000007fe`87dd08
rcx,qword ptr [rbp+8]
000007fe`87dbda
000007fe`87d30197 ff12
qword ptr [rdx]
000007fe`87d30199 90
000007fe`87dc430
000007fe`87d3019e 5d
000007fe`87d3019f c3
I could understand the code without exception (commented above), but how the code works when an exception was thrown? How the code goes into the code below the comment?
Some people think we should start from IL so I pasted the code below:
.method private hidebysig static
void UsingClass () cil managed noinlining
// Method begins at RVA 0x23bc
// Code size 25 (0x19)
.maxstack 1
.locals init (
[0] class SimpleConsole.DisposableClass dc
IL_0000: newobj instance void SimpleConsole.DisposableClass::.ctor()
IL_0005: stloc.0
IL_0006: ldloc.0
IL_0007: call void SimpleConsole.Program::DoSomething(object)
IL_000c: leave.s IL_0018
} // end .try
IL_000e: ldloc.0
IL_000f: brfalse.s IL_0017
IL_0011: ldloc.0
IL_0012: callvirt instance void [mscorlib]System.IDisposable::Dispose()
IL_0017: endfinally
} // end handler
IL_0018: ret
} // end of method Program::UsingClass
But I don't think it helps since IL almost keeps everything here in C# like the complete try...finally statement. What I want to understand is how the native code handles exception here.
解决方案 The jitter does a lot more than what's ever visible from the Disassembly window.
For one, it generates a table that describes the lifetime and storage of local variables.
Very important for the garbage collector, it needs that table to find object references.
And it generates an unwind table for exceptions.
Which has a very desirable property, it makes a try statement free.
There is zero cost in writing code that has exception handling, no code is required to enter a try block.
So you don't see any in the dissassembly.
There is no easy way to locate that table from the debugger.
A pretty decent description of them .
本文地址: &
我在C#写了一个非常简单的类:
类DisposableClass:IDisposable的{
公共无效的Dispose(){}
静态无效UsingClass(){//第31行
使用(变种直流=新DisposableClass()){// 32行
DoSomething的(DC); //行33
我甩了本土code JIT后,与WinDBG中它:
0:000> !üd30120
普通JIT产生code
SimpleConsole.Program.UsingClass()
开始d30120,大小80
C:\项目\ SimpleConsole \ SimpleConsole \的Program.cs @ 32:
>>> 000007fe`87d30120 55推RBP
000007fe`87dec30分RSP,30H
000007fe`87dc2420 LEA RBP,[RSP + 20H]
000007fe`87d00 MOV四字PTR [RBP],可吸入悬浮粒子
000007fe`87d MOV qword的ptr的[RBP + 8],0
000007fe`87dd6b47eeff LEA RCX,[000007fe`87c148a8]
000007fe`87d3013d e8fe24665f调用CLR + 0xfe`e7392640)(JitHelp:CORINFO_HELP_NEWSFAST)//新DisposableClass()
000007fe`87d08 MOV四字PTR [RBP + 8],RAX
C:\项目\ SimpleConsole \ SimpleConsole \的Program.cs @ 33:
000007fe`87dd08 MOV RCX,四字PTR [RBP + 8]
000007fe`87d3014a e8d1beeeff调用000007fe`87c1c020(SimpleConsole.Program.DoSomething(System.Object的),mdToken:0012)
000007fe`87d3014f 90 NOP
000007fe`87d30150 90 NOP
C:\项目\ SimpleConsole \ SimpleConsole \的Program.cs @ 35:
000007fe`87dd08 MOV RCX,四字PTR [RBP + 8]
000007fe`87dd1dc4feeeff LEA R11,[000007fe`87c20020]
000007fe`87d3015c ff15befeeeff电话四字PTR [000007fe`87c20020] //调用Dispose()
000007fe`87d30162 90 NOP
000007fe`87d10 LEA RSP,[RBP + 10H]
000007fe`87d30167 5D流行RBP
000007fe`87d30168 C3 RET
//我可以理解code以上(不抛出异常)。
C:\项目\ SimpleConsole \ SimpleConsole \的Program.cs @ 32:
000007fe`87d30169 55推RBP
000007fe`87dec30分RSP,30H
000007fe`87d20 MOV RBP,四字PTR [RCX + 20H]
000007fe`87dc2420 MOV四字PTR [RSP + 20H],RBP
000007fe`87dd20 LEA RBP,[RBP + 20H]
C:\项目\ SimpleConsole \ SimpleConsole \的Program.cs @ 35:
000007fe`87dd0800 CMP四字PTR [RBP + 8],0
000007fe`87d JE 000007fe`87d30199
000007fe`87d97feeeff LEA RDX,[000007fe`87c20020]
000007fe`87d08 MOV RAX,四字PTR [RBP + 8]
000007fe`87d CMP字节PTR [RAX] 0
000007fe`87dd08 MOV RCX,四字PTR [RBP + 8]
000007fe`87dbda MOV R11,RDX
000007fe`87d30197 FF12电话四字PTR [RDX]
000007fe`87d30199 90 NOP
000007fe`87dc430添加RSP,30H
000007fe`87d3019e 5D流行RBP
000007fe`87d3019f C3 RET
我能理解无一例外code(以上评论),但一个异常被抛出时,code是如何工作的?如何在code进入注释下的code?
有些人认为我们应该从IL开始,所以我粘贴了以下code:
。方法私人hidebysig静
无效UsingClass()CIL管理noinlining
//方法开始于RVA 0x23bc
// code尺寸25(的0x19)
.maxstack 1
.locals的init(
[0]类SimpleConsole.DisposableClass直流
IL_0000:newobj实例无效SimpleConsole.DisposableClass ::构造函数()
IL_0005:stloc.0
IL_0006:ldloc.0
IL_0007:调用无效SimpleConsole.Program :: DoSomething的(对象)
IL_000c:leave.s IL_0018
} //结束。尝试
IL_000e:ldloc.0
IL_000f:brfalse.s IL_0017
IL_0011:ldloc.0
IL_0012:callvirt实例无效[mscorlib程序] System.IDisposable的::的Dispose()
IL_0017:endfinally
} //结束处理
IL_0018:RET
法计划} //结束:: UsingClass
但我不认为它有助于IL以来这里几乎使一切在C#中,如完整的尝试...最后语句。我想了解的是如何本地code在这里处理异常。
解决方案 抖动做了很多比是从反汇编窗口才可见多。为一体,它生成一个描述的寿命和存储局部变量的表。垃圾收集器非常重要,它需要一个表来寻找对象引用。
和它生成展开表例外。其中有一个的非常的可取性,它使一个尝试语句免费。有书面code零成本,有异常处理,没有code需要输入一个try块。所以你看不到任何的dissassembly。有没有简单的方法来找到表的调试器。其中的pretty的体面描述。
本文地址: &
扫一扫关注官方微信基于halcon10.0二次开发基本步骤(VS2010&C#.net)
http://blog.csdn.net/fred_yang2013/article/details/9666157
。该程序是自带的Sobel_amp例子,选项一定要和下图相同!要不然运行时会出错:
右击-&选择项:
,并且在其中添加using&HalconDotN&头文件
n(hWindowControl1.HalconWindow);
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。Specifically the error occurs in the Resources.Designer.cs:
The namespace 'ModulusFE' already contains a definition for 'StockChartX'
Resources.Designer.cs
ModulusFE.StockChartX
I've googled this and am still quite confused. Does anyone know anything I might try?
I have tried rebuilding and cleaning, as well as renaming the Resources.Designer.cs file in hopes that it would rebuild, but no luck.
The top of the code says this:
// &auto-generated&
This code was generated by a tool.
Runtime Version:4.0.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
// &/auto-generated&
Any ideas whatsoever would be appreciated.
解决方案 I had this happen to me about a year ago and I don't remember exactly what the root cause was, but there are two things you might try:
If it's an auto-generated file (as 'Resources.Designer.cs' tend to be), try deleting it and letting VS re-generate it.
Either separately or in conjunction with #1, select Show All Files in the Solution Explorer or open the solution folder in Windows Explorer - it could be that a version of the file somehow got excluded from the project and is therefor 'invisible' to VS but still makes it angry...
本文地址: &
具体来说,错误出现在 Resources.Designer.cs 中:
错误2命名空间'ModulusFE'已经包含'StockChartX'的定义Resources.Designer.cs 11 21 ModulusFE.StockChartX
ve googled这个,我还是很困惑。有人知道我可以尝试什么吗?
我已经尝试重建和清理,以及重命名 Resources.Designer.cs
代码的顶部表示:
//& auto-generated&
//此代码是由一个工具生成的。
//运行时版本:4.0.
//对此文件的更改可能会导致不正确的行为,如果 //重新生成代码,将会丢失。
//& / auto-generated&
任何想法都会受到赞赏。
解决方案 大约一年前我发生过这种情况,我不记得是什么根本原因,但有两件事你可以尝试:
如果是自动生成的文件(如“Resources.Designer.cs”所示),请尝试删除它并让VS重新生成它。
单独或与#1结合使用,在解决方案资源管理器中选择显示所有文件或在Windows资源管理器中打开解决方案文件夹 - 该文件的某个版本不知何故被排除在项目之外,并且是“看不见”到VS,但仍然让它生气...
本文地址: &
扫一扫关注官方微信}

我要回帖

更多关于 佳文vc 277cs 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信