TravelsManagementSystem

TravelsManagementSystem

本文介绍了错误&将项目放入 TFS 后的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 Web 应用程序,它正在成功构建,错误为 0 &警告,现在我又有一名成员和我一起从事同一个项目,我已将我的解决方案迁移到 TFS,但现在在构建时我收到 5 个错误和 221 个警告.

I have created a web application,it is getting build successfully with 0 error & warning,now i have one more member with me to work on same project,i have migrated my solution to TFS,but now while building i am getting 5 errors and 221 warnings.

错误在 5 个位置相同(以下方法或属性之间的调用不明确:'ExtensionMethods.ChkDBNull(object)' 和 'ExtensionMethods.ChkDBNull(object)')AND

Error is same on 5 locations(The call is ambiguous between the following methods or properties: 'ExtensionMethods.ChkDBNull(object)' and 'ExtensionMethods.ChkDBNull(object)')AND

警告在不同文件和类的 221 个不同位置也相同(D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\DAL\Master\DALTravelPlace.cs"中的类型TravelsManagementSystem.Forms.Master.TravelPlaceMst.DALTravelPlace"与导入的类型TravelsManagementSystem.PlaceMst.TravelPlace.cs"冲突.DALTTravelPlace' in 'd:\Anuj\Projects\Travel\TravelsManagementSystem\bin\TravelsManagementSystem.dll'.使用在'D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\DAL\Master\DALTravelPlace.cs'中定义的类型.D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\BLL\Master\BLLTravelPlace.cs)

Warning is also same in 221 differernt location with different files and classes(The type 'TravelsManagementSystem.Forms.Master.TravelPlaceMst.DALTravelPlace' in 'D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\DAL\Master\DALTravelPlace.cs' conflicts with the imported type 'TravelsManagementSystem.Forms.Master.TravelPlaceMst.DALTravelPlace' in 'd:\Anuj\Projects\Travel\TravelsManagementSystem\bin\TravelsManagementSystem.dll'. Using the type defined in 'D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\DAL\Master\DALTravelPlace.cs'. D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code\BLL\Master\BLLTravelPlace.cs)

这是检查null的扩展方法

This is the extension method for checking null

public static class ExtensionMethods
{
    public static Object ChkDBNull(this object obj)
    {
        if (obj != null)
        { return obj; }
        else
        { return DBNull.Value; }
    }
}

插入数据时使用

 OraPara[i + 5] = new OracleParameter("ic_consulate_addr3", OracleType.VarChar);
                    OraPara[i + 5].Value = objBELConsulate._CONSULATE_ADDR3.ChkDBNull();

                    OraPara[i + 6] = new OracleParameter("ic_consulate_addr4", OracleType.VarChar);
                    OraPara[i + 6].Value = objBELConsulate._CONSULATE_ADDR4.ChkDBNull();

推荐答案

您可能不小心将文件夹从一个项目拖到另一个项目,从而有效地复制了系统中的代码.

It looks like you may have accidentally dragged a folder from one project to another effectively duplicating the code in your system.

文件夹 D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code 是网站吗?那里应该有一个 DAL 文件夹吗?

Is the folder D:\Anuj\Projects\Travel\TravelsManagementSystem\App_Code for a website? and should there be a DAL folder in there?

这篇关于错误&将项目放入 TFS 后的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 21:55