OpenAC.Net.NFSe
1.8.2
Prefix Reserved
dotnet add package OpenAC.Net.NFSe --version 1.8.2
NuGet\Install-Package OpenAC.Net.NFSe -Version 1.8.2
<PackageReference Include="OpenAC.Net.NFSe" Version="1.8.2" />
<PackageVersion Include="OpenAC.Net.NFSe" Version="1.8.2" />
<PackageReference Include="OpenAC.Net.NFSe" />
paket add OpenAC.Net.NFSe --version 1.8.2
#r "nuget: OpenAC.Net.NFSe, 1.8.2"
#:package OpenAC.Net.NFSe@1.8.2
#addin nuget:?package=OpenAC.Net.NFSe&version=1.8.2
#tool nuget:?package=OpenAC.Net.NFSe&version=1.8.2
OpenAC.Net.NFSe
Biblioteca .NET para emissão, consulta, substituição e cancelamento de notas fiscais de serviço eletrônicas (NFS-e). O componente OpenNFSe usa o código IBGE do município para selecionar o provedor. As operações disponíveis dependem do serviço oferecido pela prefeitura.
Instalação
dotnet add package OpenAC.Net.NFSe
Municípios e operações
O catálogo associa cada município ao provedor e à versão do leiaute. Há implementações para padrões como ABRASF 1.x e 2.x e para provedores como Ginfes, Betha, ISSNet, SigISS e WebISS. Consulte a entrada do código IBGE da prefeitura para identificar a integração usada. Catálogo de municípios.
Conforme o provedor, é possível transmitir RPS individualmente ou em lote, consultar o processamento pelo protocolo, localizar a NFS-e pelo RPS e solicitar cancelamento ou substituição. O envio síncrono e o envio com consulta posterior dependem das operações oferecidas pela prefeitura.
Enviar um RPS e consultar o lote em homologação
O exemplo usa um arquivo rps.xml preenchido no leiaute do município e pressupõe que o provedor aceite envio assíncrono e consulta de lote. Informe o código IBGE, os dados do prestador e o caminho do certificado PFX nas variáveis de ambiente abaixo. Disponibilize os esquemas XML do pacote no diretório Schemas da aplicação. Se o provedor exigir credenciais de acesso, configure também WebServices.Usuario e WebServices.Senha.
using System;
using System.IO;
using OpenAC.Net.DFe.Core.Common;
using OpenAC.Net.NFSe;
using var nfse = new OpenNFSe();
var config = nfse.Configuracoes;
config.WebServices.CodigoMunicipio = int.Parse(Ler("NFSE_MUNICIPIO"));
config.WebServices.Ambiente = DFeTipoAmbiente.Homologacao;
config.PrestadorPadrao.CpfCnpj = Ler("NFSE_CNPJ");
config.PrestadorPadrao.InscricaoMunicipal = Ler("NFSE_INSCRICAO");
config.Certificados.Certificado = Ler("NFSE_PFX");
config.Certificados.Senha = Ler("NFSE_SENHA_PFX");
config.Arquivos.PathSchemas = Path.Combine(AppContext.BaseDirectory, "Schemas");
using var xml = File.OpenRead("rps.xml");
nfse.NotasServico.Load(xml);
var lote = int.Parse(Ler("NFSE_LOTE"));
var envio = nfse.Enviar(lote);
if (!envio.Sucesso || string.IsNullOrWhiteSpace(envio.Protocolo))
{
foreach (var erro in envio.Erros)
Console.Error.WriteLine($"{erro.Codigo} - {erro.Descricao}");
return;
}
Console.WriteLine($"Lote {lote}, protocolo {envio.Protocolo}");
var consulta = nfse.ConsultarLoteRps(lote, envio.Protocolo);
foreach (var erro in consulta.Erros)
Console.Error.WriteLine($"{erro.Codigo} - {erro.Descricao}");
Console.WriteLine($"Situação do lote: {consulta.Situacao}");
foreach (var nota in consulta.Notas)
Console.WriteLine($"NFS-e {nota.IdentificacaoNFSe.Numero}");
static string Ler(string nome) => Environment.GetEnvironmentVariable(nome)
?? throw new InvalidOperationException($"Informe {nome}.");
O protocolo identifica o lote recebido. Guarde-o junto ao número do lote. Se a primeira consulta indicar processamento pendente, use esses mesmos dados para consultar novamente no intervalo indicado pelo provedor.
A aplicação de demonstração também exemplifica o preenchimento de notas e a seleção de municípios. Demonstração em Avalonia.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 is compatible. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Net.Http (>= 4.3.4)
- System.Security.Cryptography.Xml (>= 11.0.0)
-
.NETFramework 4.7
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Net.Http (>= 4.3.4)
- System.Security.Cryptography.Xml (>= 11.0.0)
-
.NETFramework 4.8
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Net.Http (>= 4.3.4)
- System.Security.Cryptography.Xml (>= 11.0.0)
-
.NETStandard 2.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Security.Cryptography.Xml (>= 11.0.0)
-
net10.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
-
net11.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
-
net6.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
-
net7.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
-
net8.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
-
net9.0
- OpenAC.Net.Core (>= 1.6.0)
- OpenAC.Net.DFe.Core (>= 1.8.2)
- System.Drawing.Common (>= 11.0.0)
- System.Security.Cryptography.Xml (>= 11.0.0)
- System.ServiceModel.Http (>= 10.1.0)
- System.ServiceModel.Primitives (>= 10.1.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on OpenAC.Net.NFSe:
| Package | Downloads |
|---|---|
|
OpenAC.Net.NFSe.DANFSe.QuestPdf
Biblioteca de impressão de DANFSe usando o QuestPdf. |
|
|
OpenAC.Net.NFSe.DANFSe.FastReport.OpenSource
Biblioteca de impressão de DANFSe usando o FastReport OpenSource. |
|
|
OpenAC.Net.NFSe.DANFSe.PDFSharp
Biblioteca para geração e impressão de DANFSe (Documento Auxiliar da NFS-e) em PDF usando PDFsharp (100% Open Source / MIT). |
|
|
OpenAC.Net.NFSe.Web
Integração da OpenAC.Net.NFSe com DI, logging e serviços do ASP.NET Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.8.2 | 93 | 12/2/2026 |
| 1.8.1 | 391 | 10/28/2026 |
| 1.8.0 | 1,908 | 8/21/2026 |
| 1.7.6 | 590 | 8/8/2026 |
| 1.7.5 | 2,366 | 6/16/2026 |
| 1.7.4 | 210 | 6/9/2026 |
| 1.7.3 | 623 | 5/18/2026 |
| 1.7.2 | 309 | 5/8/2026 |
| 1.7.1 | 3,875 | 2/7/2026 |
| 1.7.0 | 332 | 1/17/2026 |
| 1.6.4 | 886 | 12/15/2025 |
| 1.6.3 | 450 | 11/7/2025 |
| 1.6.2 | 14,791 | 6/14/2025 |
| 1.6.1 | 2,556 | 3/22/2025 |
| 1.6.0.1 | 14,675 | 9/24/2024 |
| 1.5.1 | 2,589 | 8/16/2024 |
| 1.5.0.2 | 1,053 | 3/13/2024 |
| 1.5.0.1 | 466 | 2/6/2024 |
| 1.5.0 | 4,920 | 2/12/2023 |
| 1.5.0-rc.2 | 406 | 4/27/2022 |