简体   繁体   English

调试错误:“当前位置无源代码”

[英]Debug error: “No Source Code Available for the Current Location”

I have been debugging a program for some time. 我已经调试了一段时间的程序。 The code below is part of an abstract class and this.initialize() is an abstract method that is overridden by a child class. 下面的代码是一个抽象类的一部分,而this.initialize()是一个被子类覆盖的抽象方法。 After changing Initizalize in the child class, I get the error "No Source Code Available for the Current Location" when debugging. 在子类中更改Initizalize后,调试时出现错误“当前位置无源代码”。 The dialog box pops up at this method, so I suspect that is the cause of the problem. 对话框将以这种方法弹出,因此我怀疑这是问题的原因。 Any ideas? 有任何想法吗?

public ExternalSystemAdapterClass(ArchiveServiceConfigurationHandler archiveServiceConfigurationHandler, SystemType adapterConfiguration)
        {
            // Init configs...
            this.archiveServiceConfigurationHandler = archiveServiceConfigurationHandler;
            this.adapterConfiguration = adapterConfiguration;
            this.dbProviderFactory = DalFactory.GetFactory(this.adapterConfiguration);

            sqlDalExternal = new SqlCommonDAL(this.adapterConfiguration.DatabaseInformation.ExternalDatabaseInformation.connectionString, this.dbProviderFactory);

            // Init validations...
            this.metaDataValidationsSP = new Collection<MetaDataValidationType>();
            this.metaDataValidationsBL = new Collection<MetaDataValidationType>();
            this.InitializeMetaDataValidations();

            // Init (clean up unfinished jobs etc.)
            this.Initialize(); // DEBUG ERROR: "No Source Code Available for the Current Location"

            // Init data retrieval...
            this.dataResponseQueue = new Queue<ExternalSystemDataResponse>();
            this.alreadyProcessedDataTable = new DataTable();
            this.doRun = true;
            this.externalDataRetrievalThread = new Thread(ExternalDataRetrievalThreadMethod);
            this.externalDataRetrievalThread.Start();
        }

Could you tell us if your code is working at least, even if not debuggable? 您能否告诉我们,即使无法调试,您的代码是否也至少可以正常工作?

The very first idea that come into my mind is that your Initialize method should be declared as virtual . 我想到的第一个想法是,应该将Initialize方法声明为virtual To help you further, you should tell us if the code works, and give some child class code parts. 为了进一步帮助您,您应该告诉我们代码是否有效,并提供一些子类代码部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM