<?xml version="1.0" encoding="us-ascii"?><InstanceReport xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><Version>2.4.0.8</Version><ReportLongName>000070 - Disclosure - Note 2. Long-term Debt and Line of Credit</ReportLongName><DisplayLabelColumn>true</DisplayLabelColumn><ShowElementNames>false</ShowElementNames><RoundingOption /><HasEmbeddedReports>false</HasEmbeddedReports><Columns><Column FlagID="0"><Id>1</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><CurrencyCode /><FootnoteIndexer /><hasSegments>false</hasSegments><hasScenarios>false</hasScenarios><MCU><KeyName /><CurrencySymbol /><contextRef><ContextID>D130101_130630</ContextID><EntitySchema>http://www.sec.gov/CIK</EntitySchema><EntityValue>0000904896</EntityValue><PeriodDisplayName /><PeriodType>duration</PeriodType><PeriodStartDate>2013-01-01T00:00:00</PeriodStartDate><PeriodEndDate>2013-06-30T00:00:00</PeriodEndDate><Segments /><Scenarios /></contextRef><UPS /><CurrencyCode /><OriginalCurrencyCode /></MCU><CurrencySymbol /><Labels><Label Key="CalendarSupplement" Id="0" Label="6 Months Ended" /><Label Key="Calendar" Id="1" Label="Jun. 30, 2013" /></Labels></Column></Columns><Rows><Row FlagID="0"><Id>1</Id><IsAbstractGroupTitle>true</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>1</Level><ElementName>us-gaap_DisclosureTextBlockAbstract</ElementName><ElementPrefix>us-gaap_</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText /><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>xbrli:stringItemType</ElementDataType><SimpleDataType>string</SimpleDataType><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>Notes</Label></Row><Row FlagID="0"><Id>2</Id><IsAbstractGroupTitle>false</IsAbstractGroupTitle><LabelSeparator>

</LabelSeparator><Level>2</Level><ElementName>us-gaap_DebtDisclosureTextBlock</ElementName><ElementPrefix>us-gaap_</ElementPrefix><IsBaseElement>true</IsBaseElement><BalanceType>na</BalanceType><PeriodType>duration</PeriodType><IsReportTitle>false</IsReportTitle><IsSegmentTitle>false</IsSegmentTitle><IsCalendarTitle>false</IsCalendarTitle><IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow><IsEquityAdjustmentRow>false</IsEquityAdjustmentRow><IsBeginningBalance>false</IsBeginningBalance><IsEndingBalance>false</IsEndingBalance><IsReverseSign>false</IsReverseSign><FootnoteIndexer /><Cells><Cell FlagID="0" ContextID="D130101_130630" UnitID=""><Id>1</Id><IsNumeric>false</IsNumeric><IsRatio>false</IsRatio><DisplayZeroAsNone>false</DisplayZeroAsNone><NumericAmount>0</NumericAmount><RoundedNumericAmount>0</RoundedNumericAmount><NonNumbericText>&lt;!--egx--&gt;&lt;p style='margin:0in;margin-bottom:.0001pt;text-align:justify'&gt;&lt;b&gt;Note 2.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Long-Term Debt and Line of Credit&lt;/b&gt;&lt;/p&gt; &lt;p style='margin:0in;margin-bottom:.0001pt;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;During the second quarter of 2013, the Company had a line of credit with Monroe Bank + Trust, or the Bank, up to $400,000 bearing interest at the Wall Street Journal Prime Rate (3.25% at June 30, 2013) plus 0.75%, but in no event less than 5.00%, and secured by a first lien on all assets (except equipment) of the Company.&amp;#160; In August 2013 it is expected to be renewed with a new maturity date of August 2014.&amp;#160; Two certificates of deposit totaling us-gaap:LineOfCreditFacilityCollatera|Label=Line of Credit Facility, Collateral|Time=2013-06-30|Unit=USD|Precision=INF&amp;#187;$141,924 from the Bank are held as a condition of maintaining the line of credit.&amp;#160; At June 30, 2013, the Company had $35,000 of borrowing capacity under the credit facility.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;In December 2012, the Company borrowed $25,000 from a stockholder to provide operating capital.&amp;#160; The Note Payable was for a term of three months at an interest rate of 12%.&amp;#160; In February 2013, the stockholder converted the Note Payable to common stock at the fair market value of the stock at the time of conversion.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin:0in;margin-bottom:.0001pt;text-align:justify'&gt;In November 2012, the Company received a Notice and Demand of Payment Withdrawal Liability from Central States Southeast and Southwest Areas Pension Fund (the &amp;#147;Notice&amp;#148;), the pension trustee that was funded by the Company for the benefit of its former employees at its City of Toledo operation.&amp;#160; The Notice demands a payment of $412,576, payable monthly over 20 years at an interest rate of approximately 2.8% at $2,250 per month, or approximately $27,000 per year.&amp;#160; Payments at the end of the 20 year period would total $540,065.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;In 2011 the Company borrowed $200,000 with a Promissory Note payable to a related party of Timothy Kasmoch, the Company&amp;#146;s President and Chief Executive Officer, at 12% interest prepaid for a period of three months, renewable for an additional three months by the prepayment of additional interest and secured by certain equipment.&amp;#160; Mr. Kasmoch has personally guaranteed the repayment of this Note.&amp;#160; The Company extended the Note on all four due dates during 2012 and again on January 30, April 30 and July 30, 2013, and is now due October 30, 2013.&amp;#160; The Company expects to extend the Note on or before the due date but pay the Note in full during 2013 or early 2014.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;From the beginning of 2006 through second quarter 2013, the Company has borrowed a total of $1,677,100 from ten lenders to purchase processing and automotive equipment.&amp;#160; As of June 30, 2013, a total of five term notes are outstanding, ranging from 6.2% to 8.8% interest for terms ranging three to five years, monthly payments totaling approximately $8,500 and all secured by equipment.&amp;#160; The total amount owed on all equipment-secured notes as of June 30, 2013 was approximately $130,000 and all notes are expected to be paid in full on the applicable maturity date, the last of which is in March 2016.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:3.0pt;margin-right:0in;margin-bottom:6.0pt;margin-left:0in;text-align:justify;text-indent:.5in;text-indent:0in'&gt;In 2009 the Company approved an offering of up to $1,000,000 of Convertible Debentures (the &amp;#147;Debentures&amp;#148;), convertible at any time into our unregistered common stock at $2.00 per share. &amp;#160;The Debentures were issuable in $5,000 denominations, are unsecured and have a stated interest rate of 8%, payable quarterly to holders of record.&amp;#160; The Company has timely paid all accrued interest due to all Debenture holders of record as of each quarter-end date starting in July 2009.&amp;#160; At any time, the Company may redeem all or a part of the Debentures at face value plus unpaid interest.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:58.5pt;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;During 2009 the Company issued $765,000 of Debentures to a total of twenty-three accredited investors, and one investor converted $10,000 of Debentures into unregistered common stock.&amp;#160; During 2010 the Company issued $55,000 of Debentures, and three investors converted a total of $90,000 of Debentures into unregistered common stock.&amp;#160; The Debentures matured at June 30, 2011, however sixteen investors holding Debentures totaling $455,000 elected to replace them with new ones that matured on June 30, 2013.&amp;#160; All other features of the &amp;#147;expired&amp;#148; Debentures remained the same in the replacement ones, except for the new maturity date.&amp;#160; Of the three investors totaling $265,000 who did not replace their existing Debentures with new ones, two investors totaling $215,000 had their Debentures repaid and one investor converted $50,000 into unregistered common stock concurrent at June 30, 2011.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify;text-indent:.5in'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:0in;text-align:justify'&gt;As of June 30, 2013, the Company held $455,000 of Debentures, but defaulted and did not pay the holders the principal amount due, all of which currently remain outstanding.&amp;#160; The Company will continue to accrue additional interest on the principal amount at the rate set forth in the Debentures&lt;b&gt; &lt;/b&gt;until the principal amount is paid in full.&amp;#160; The Company expects to pay all accrued interest due and the principal amount to all outstanding holders of the Debentures after completing substitute financial arrangements, though there can be no assurance of the timing of receipt of these funds and amounts available from these substitute arrangements.&lt;/p&gt; &lt;p style='margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;layout-grid-mode:line;margin-left:58.5pt;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin:0in;margin-bottom:.0001pt;text-align:justify'&gt;Because the fair market value of the Company&amp;#146;s common stock (the underlying security in the Debentures) may have been above the conversion price of $2.00 per share at the date of issuance, the Company was required under GAAP to record a discount given for certain (now) &amp;#147;expired&amp;#148; Debentures sold, which totaled $184,975.&amp;#160; The discount was then required to be amortized as a period expense over the periods the Debentures were scheduled to be outstanding, which averaged 20 months, through the maturity date of June 30, 2011.&amp;#160; Amortization expense on these &amp;#147;expired&amp;#148; Debentures for each of the six months ended June 30, 2013 and 2012 was zero.&lt;/p&gt; &lt;p style='margin:0in;margin-bottom:.0001pt;margin-left:58.5pt;text-align:justify'&gt;&amp;nbsp;&lt;/p&gt; &lt;p style='margin:0in;margin-bottom:.0001pt;text-align:justify'&gt;For periods subsequent to June 30, 2011, the Company is required under GAAP to record a discount for certain Debentures replaced, which totals $32,737 and was recorded as a gain on debt modification during the quarter ended June 30, 2011.&amp;#160; The discount was required to be amortized as a period expense over the subsequent eight quarters the Debentures were scheduled to be outstanding.&amp;#160; Amortization expense for each of the six months ended June 30, 2013 and 2012 was ($8,184).&lt;/p&gt;</NonNumbericText><FootnoteIndexer /><CurrencyCode /><CurrencySymbol /><IsIndependantCurrency>false</IsIndependantCurrency><ShowCurrencySymbol>false</ShowCurrencySymbol><DisplayDateInUSFormat>false</DisplayDateInUSFormat></Cell></Cells><ElementDataType>nonnum:textBlockItemType</ElementDataType><SimpleDataType>na</SimpleDataType><ElementDefenition>The entire disclosure for information about short-term and long-term debt arrangements, which includes amounts of borrowings under each line of credit, note payable, commercial paper issue, bonds indenture, debenture issue, own-share lending arrangements and any other contractual agreement to repay funds, and about the underlying arrangements, rationale for a classification as long-term, including repayment terms, interest rates, collateral provided, restrictions on use of assets and activities, whether or not in compliance with debt covenants, and other matters important to users of the financial statements, such as the effects of refinancing and noncompliance with debt covenants.</ElementDefenition><ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Accounting Standards Codification

 -Topic 505

 -SubTopic 10

 -Section 50

 -Paragraph 3

 -URI http://asc.fasb.org/extlink&amp;oid=6928386&amp;loc=d3e21475-112644



Reference 2: http://www.xbrl.org/2003/role/presentationRef

 -Publisher SEC

 -Name Regulation S-X (SX)

 -Number 210

 -Section 02

 -Paragraph 19, 20, 22

 -Article 5



Reference 3: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Statement of Financial Accounting Standard (FAS)

 -Number 129

 -Paragraph 2, 4

 -LegacyDoc This reference is SUPERSEDED by the Accounting Standards Codification effective for interim and annual periods ending after September 15, 2009.  This reference is included to help users transition from the previous accounting hierarchy and will be removed from future versions of this taxonomy.



Reference 4: http://www.xbrl.org/2003/role/presentationRef

 -Publisher FASB

 -Name Accounting Standards Codification

 -Topic 210

 -SubTopic 10

 -Section S99

 -Paragraph 1

 -Subparagraph (SX 210.5-02.19,20,22)

 -URI http://asc.fasb.org/extlink&amp;oid=6877327&amp;loc=d3e13212-122682



</ElementReferences><IsTotalLabel>false</IsTotalLabel><UnitID>0</UnitID><Label>Note 2. Long-term Debt and Line of Credit</Label></Row></Rows><Footnotes /><IsEquityReport>false</IsEquityReport><ReportName>Note 2. Long-term Debt and Line of Credit</ReportName><MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel><SharesRoundingLevel>UnKnown</SharesRoundingLevel><PerShareRoundingLevel>UnKnown</PerShareRoundingLevel><ExchangeRateRoundingLevel>UnKnown</ExchangeRateRoundingLevel><HasCustomUnits>true</HasCustomUnits><IsEmbedReport>false</IsEmbedReport><IsMultiCurrency>false</IsMultiCurrency><ReportType>Sheet</ReportType><RoleURI>http://www.nviro.com/20130630/role/idr_DisclosureNote2LongTermDebtAndLineOfCredit</RoleURI><NumberOfCols>1</NumberOfCols><NumberOfRows>2</NumberOfRows></InstanceReport>
