【发布时间】:2014-06-10 12:13:42
【问题描述】:
我已将问题简化为以下代码。
using WeinCad.Plugin.MoineauMachinePath;
namespace WeinCad.Plugin.Foo
{
public class Foo
{
// This line is a compiler error
// (Cannot resolve symbol MoineauMachinePath )
private WeinCad.Plugin.MoineauMachinePath.MachinePathSolverPropertiesViewModel X;
// Implicity referenced it is ok
private MachinePathSolverPropertiesViewModel Y;
}
}
如果我使用对类的显式引用,则会出现编译器错误。为了证明命名空间是正确的,我还将命名空间导入范围并隐式引用该类。只有显式引用有误。
编辑
智能感知显示有一个像这样嵌套双精度的命名空间。那将是问题的根源。不知道它是如何在那里编码的。
编辑
问题的根源是损坏的 Resources.Designer.cs 文件。
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WeinCad.Plugin.WeinCad.Plugin.BasicFolders.Properties
{
using System;
不知道这是怎么发生的。删除资源文件,然后重新创建它我得到
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WeinCad.Plugin.BasicFolders.Properties {
using System;
没有讨厌的重复。这仍然是一个悬而未决的问题。
【问题讨论】:
-
你试过
global::WeinCad.Plugin.MoineauMachinePath.MachinePathSolverPropertiesViewModel吗? -
对于信息,这工作:pastie.org/9277079 - 所以无论问题是什么,它需要更多的代码,而不仅仅是你显示的代码
-
是的,但为什么?真正的问题出在 XAML 编译器生成的“g.cs”文件中,所以我无法进行那么简单的修复。
-
“真正的问题在于 g.cs 文件” - 与发布的代码完全不同?
-
我得到任何like错误的唯一方法是在
Foo中定义一个WeinCad和一个WeinCad+Plugin。有可能是这样吗?
标签: c# visual-studio-2012 compiler-errors namespaces