0

I'm trying to publish some software to an FTP site with Visual Studio (VS) 2015 community, The output window shows an error

An error occured trying to enumerate the contents of folder ''. An unknown WinINet error has occurred (code 12113).

After some Googling, it shows this issue is caused by the Firewall.

As it's fairly safe in my environment, I disable the W10 firewall, and retry and it publishes as expected.

The problem is, I don't understand how to make this an exception to the Firewall. I can't see what port the FTP is using any where, nor can I add it by program as I'd have to add the entire VS2015 which seems dangerous.

I have not manually or knowingly changed any settings in the Firewall.

How do I permanently allow FTP access from VS2015?

Edit

Within each profile (Domain, Private and public) all are set to allow outgoing connections. All incoming are blocked by default.

If I make only Domain allow for both incoming/outgoing (and other 2 profiles remain on default), nothing changes. If I then make public allow for both incoming/outgoing (and other 2 profiles remain on default), nothing changes. BUT... if I make Private allow incoming / outgoing (and other 2 profiles on default), then it works.

Naturally I don't want to leave private profile just 'open' like this.

5
  • 1
    Please include the exact error message in your question. Also, did you change any firewall settings? Because by default no outgoing connections are blocked.
    – Daniel B
    Commented Nov 17, 2015 at 12:34
  • I have not knowingly changed any settings Commented Nov 17, 2015 at 12:40
  • Furthermore any application that needed access should generate a prompt to allow/disallow access.
    – Ramhound
    Commented Nov 17, 2015 at 12:56
  • That only applies to program that want to listen for connections. This isn’t relevant here, unless VS is mistakenly trying to use FTP in Active Mode. I’m still waiting for the error message, @MyDaftQuestions.
    – Daniel B
    Commented Nov 17, 2015 at 20:04
  • @DanielB, the question has been updated. Commented Nov 18, 2015 at 9:23

2 Answers 2

2

So I’ll shamelessly steal this answer: Enable FTP passive mode. Otherwise FTP will not work behind NAT routers or dedicated firewalls.

Screenshot of Publish settings

Modifying firewall setting is not an appropriate solution because it is not portable. Passive mode is.

0

You will need to allow port 21 outbound access to upload to ftp sites.

From the Windows Firewall console,

select outbound rules -> next
new rule -> next
selec port rule -> next
Select rule applies to TCP and specify the remote port 21 -> next
Select Allow the connection -> next
Select the appropriate profile for your current network (domain, private, public) -> next
Give a the rule a name

EDIT:

According to this link you can set FTP open by running the following commands in an elevated command prompt:

netsh advfirewall firewall add rule name=”FTP Service” action=allow service=ftpsvc protocol=TCP dir=in

netsh advfirewall set global StatefulFTP disable

2
  • Same issue persists. Updated original question with more detail Commented Nov 18, 2015 at 9:29
  • Try opening port 21 like i mentioned in my previous post for inbound and outbound connection for your private network profile.
    – doenoe
    Commented Nov 18, 2015 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .