Ошибка при публикации visual studio

3 / 3 / 1

Регистрация: 09.08.2020

Сообщений: 46

1

VS 2019

Ошибка при публикации

22.09.2021, 17:44. Показов 8282. Ответов 7


Студворк — интернет-сервис помощи студентам

Уважаемые пользователи, почему возникает данная ошибка? Не могу опубликовать проект.

Ошибка при публикации

Ошибка при публикации

В файле «tmp4D94»:
22.09.2021 17:05:44
System.AggregateException: Произошла одна или несколько ошибок. —> Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.
— Конец трассировки внутреннего стека исключений —
—> (Внутреннее исключение #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода. <—

Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.



0



2130 / 2013 / 452

Регистрация: 17.02.2019

Сообщений: 3,270

22.09.2021, 18:14

2

А что пишут в Диагностический журнал записан сюда: "C:UsersAdminAppDataLocalTemptmp4D94.tmp".



0



3 / 3 / 1

Регистрация: 09.08.2020

Сообщений: 46

22.09.2021, 18:16

 [ТС]

3

January29, вот:
22.09.2021 17:05:44
System.AggregateException: Произошла одна или несколько ошибок. —> Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.
— Конец трассировки внутреннего стека исключений —
—> (Внутреннее исключение #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода. <—

Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.



0



2130 / 2013 / 452

Регистрация: 17.02.2019

Сообщений: 3,270

22.09.2021, 19:46

4

Yes Chad, На всякий случай сделайте бэкап проекта
Я вот полностью не уверен на все 50%. Попробуйте в Visual Studio очистить кеш NuGet по пути: Средства-Параметры-Диспетчер пакетов NuGet-Общие.
Возможно И там же Средства-Параметры-Диспетчер пакетов NuGet-Источники пакетов. Выбрать внизу Источники пакетов (компьютер):. Возможно что то с сайтом https://api.nuget.org/v3/index.json. Возможно что то его блочит.

Добавлено через 16 минут
Вот мысля проскочила наверно Учетная запись добавлена в Visual Studio



1



3 / 3 / 1

Регистрация: 09.08.2020

Сообщений: 46

22.09.2021, 19:52

 [ТС]

5

January29, к сожалению, данный способ не помог. К слову, данная ошибка возникает в любом (даже пустом) проекте.
Учетная запись не добавлена в Visual Studio.



0



2130 / 2013 / 452

Регистрация: 17.02.2019

Сообщений: 3,270

22.09.2021, 20:43

6

Вот только сейчас опубликовал. Все норм. Ну да ладно.
Обновите студию до последней версии, если не обновляли. Попробуйте восстановить через Visual Studio Installer.

Не по теме:

Будем думу думать.



1



2130 / 2013 / 452

Регистрация: 17.02.2019

Сообщений: 3,270

26.09.2021, 22:51

7

Yes Chad,как то так пишут.

Решение:

Эта ошибка возникает, когда, по крайней мере, насколько мне известно, в Visual Studio 2019 были текущие обновления. Когда я столкнулся с этой ошибкой, у меня были другие приложения в решении, похоже, что Visual Studio испытывает проблемы при создании других проектов, включенных в то же решение. Если вам нужно узнать больше о вашем конкретном сценарии проекта, проверьте окно вывода в Visual Studio на наличие сведений об ошибках. Это полезно при диагностике проблемы, например, в ошибке, зарегистрированной в консоли вывода (Сборка + IntelliSense), может быть указано: «Платформа RuntimeIdentifier» win-x64 «и платформа X86 должны быть совместимы», тогда вы будете знать, что вам нужна одна и та же платформа как в профиле платформы, так и в профиле публикации.
1. Остановите или отмените построение приложения, если сборка застряла.
2. Убедитесь, что вы сохранили свои изменения
3. Закройте Visual Studio и снова откройте свой проект.
4. Когда проект загрузится в Visual Studio 2019, очистите решение
4. Затем перестроить решение
5. После перестроенние решения опубликуйте.



0



3 / 3 / 1

Регистрация: 09.08.2020

Сообщений: 46

26.09.2021, 23:05

 [ТС]

8

Лучший ответ Сообщение было отмечено January29 как решение

Решение

Я нашел решение. Nuget.org начал принудительно использовать TLS 1.2 (и отказался от поддержки TLS 1.1 и 1.0) в начале 2020-го года. Это и вызывало ошибку при публикации приложения в Visual Studio. В Windows 7 TLS 1.2 по умолчанию отключен, однако его можно включить.
Решение было найдено здесь:https://github.com/NuGet/NuGetGallery/issues/8176



1



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

26.09.2021, 23:05

Помогаю со студенческими работами здесь

Ошибка при публикации приложения MVC с базой MS SQL Server подход Database First
Пытаюсь опубликовать приложение на локальной машине (использую Visual Studio 2013, MS SQLServer…

Стала возникать «Ошибка при создании формы» после публикации
Накануне вечером запускал нормально.
После полез в свойства проекта, воспользовался функцией…

Ошибка публикации приложения
Начал изучать VB.NET
Написал небольшой код в Visual.Studio. Пытаюсь опубликовать решение, для…

Ошибка публикации приложения
Почему Visual Basic выдает такие ошибки? При отладке программа работает отменно :(
Ошибка1 Не…

Ошибка после публикации сайта на Somee.com
Здравствуйте, зарегистрировал свой сайт, на хостере Somee.com
После публикации, в момент…

Ошибка 500 на хосте, после публикации сайта
см. что на экране… и как преодолеть?
Ошибка 500 на хосте, после публикации сайта в visual…

Ошибка браузера CefSharp после публикации проекта
в студии все замечательно работало, но после публикации проекта, при входе в форму, где реализован…

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

8

При публикации веб-приложения из Visual Studio разработчик может столкнуться с некоторыми проблемами, и не всегда текст ошибки может помочь избавиться от проблем и правильно настроить сервер.
Ниже я опишу наиболее распространенные из них.
Надеюсь, что данная статья поможет сэкономить время, большое количество которого я потратил при изучении проблем.

Давайте попробуем развернуть приложение на чистый сервер Windows 2008 R2, на котором установлена роль «Web Server (IIS)».

1. Для этого в Visual Studio (у меня Visual Studio 2012 Professional) кликаем правой мышкой на проекте и выбираем пункт меню «Publish…»
image

Откроется окно мастера публикации, в котором нужно создать профиль
image

Вводим имя профиля (я назвал профиль также, как называется мой веб-сервер — «app10») и нажимаем кнопку «ОК».
Затем заполняем поля ввода и нажимаем кнопку «Validate Connection».
image

И тут начинается самое интересное.

2. Валидация завершилась с ошибкой.
Для того, чтобы посмотреть текст ошибки, нужно щелкнуть на гиперссылке «Failed (click for details)»

3. Первая ошибка:
Could not connect to the destination computer ("app10"). On the remote computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started.)

Студия не получила ответа от сервера.
Необходимо проверить настройки веб-сервера (в моем случае он имеет доменное имя «app10»), для чего необходимо зайти в Server Manager (у меня на сервере установлена англоязычная версия Windows 2008 R2, поэтому я буду писать английский наименования пунктов меню и заголовков окон).

4. Откройте диспетчер служб IIS и выберите узел с именем машины:
image
Я скрыл имя пользователя на скриншоте.

5. В разделе «Management» нужно проверить наличие пунктов «IIS Manager Permissions», «IIS Manager Users» и «Management Service».
У меня их нет, поэтому нужно установить.
Для этого щелкните правой мышкой на пункт «Web Server (IIS)» в левой части окна «Server Manager» и выберите пункт «Add Role Services».
Откроется окно выбора роли.
В разделе «Management Tools» отметьте пункт «Management Service» и нажмите кнопку «Next».
image

В следующем окне мастера добавления роли нажмите кнопку «Install».
image

Необходимо дождаться окончания процесса добавления роли и убедиться, что все прошло успешно:
image

Закрываем окно добавления роли и опять переходим к разделу «Management» (см. пункт 5).
Необходимые нам пункты появились.
image

6. Необходимо проверить, что Брендмауэр Windows не мешает установлению соединения.
Для этого откройте оснастку «Windows Firewall with Advanced Security», которая находится в меню «Пуск» — «Administrative Tools».
Необходимо убедиться, что входящие соединения на порт 8172 разрешены.
(У меня брендмауэр вообще отключен).

7. Необходимо убедиться, что Web Management Service слушает порт 8172.
Для этого откройте в настройках сервера дважды щелкните мышкой по пункту «Management Service»
image

В открывшемся окне проверьте, что указан порт 8172, а также разрешите удаленные подключения, установив галочку «Enable remote connection».
Если не поставить эту галочку, то в мастере публикации в Visual Studio будет возникать ошибка:
Could not connect to the remote computer ("app10") using the specified process ("The Web Management Service") because the server did not respond. Make sure that the process ("The Web Management Service") is started on the destination computer. The remote server returned an error: (403) Forbidden.

Теперь нажмите кнопку «Apply» с зеленой галочкой в правой части окна надстроек.
После применения настроек нажмите там же кнопку «Start», что приведет к запуску службы.

8. Переключаемся в Visual Studio и снова нажимаем кнопку «Validate Connection» в мастере публикации.
У меня открылась ошибка сертификата, но ее можно просто игнорировать и нажать кнопку «Accept», предварительно поставив галочку «Save this certificate for future sessions of Visual Studio».

9. После этого у меня возникла ошибка 404:
Could not connect to the remote computer ("app10"). On the destination computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started. The remote server returned an error: (404) Not Found.

Необходимо убедиться, что установлен инструмент «Microsoft Web Deploy 2.0».
Для этого пройдите в «Пуск» — «Control Panel» — «Programs and Features» и проверьте наличие установленного продукта «Microsoft Web Deploy 2.0».
Если его нет, то скачайте его отсюда и установите на сервере.
Во время установки нужно выбрать тип установки «Custom» и выбрать для установки все пункты, предлагаемые инсталлятором:
image

Выполните установку.

После чего обновите окно «Programs and Features» и он у вас появится.
image

10. После установки «Microsoft Web Deploy 2.0» необходимо перезапустить службу «Web Management Service».
Теперь нажимаем кнопку «Validate Connection» в мастере публикации в Visual Studio и ВУАЛЯ!!!
Проверка успешно пройдена.
image

Нажимаем кнопку «Next» дважды и публикуем приложение на веб-сервер, нажав кнопку «Publish».

В завершение данной статьи хочу сказать, что наиболее информативные сообщения при возникновении ошибок во время публикации веб-приложения можно найти в файле логов IIS, который по умолчанию находится по следующему пути:
%SystemDrive%InetpublogsWMSvc
Только помните, что как и в случае с другими журналами IIS, данные не записываются в журнал сразу, так что вам, возможно, придется подождать пару минут, чтобы увидеть последние сообщения, или перезапустить службы веб-управления, чтобы сбросить данные журнала в лог-файл.

Удачи!

UPDATE 03.08.2015

Если во время проверки соединения с сервером (при нажатии на кнопку «Validate Connection») возникает ошибка:
Could not complete an operation with the specified provider ("contentPath") when connecting using the Web Management Service.


необходимо в диспетчере служб IIS выбрать узел с именем машины и дважды кликнуть левой клавишей мыши на пункте «Management Service Delegation»:

Бывает так, что пункт ‘Management Service Delegation’ отсутствует

Для устранения данной проблемы необходимо еще раз запустить инсталлер WebDeploy, выбрать пункт «Change» и доустановить компоненты.
Затем перезапускаем оснастку управления сервером и данный пункт появится.

В открывшемся окне необходимо добавить новое правило, нажав в правой верхней части на ссылку «Add Rule…» и выбрав пункт «Deploy Applications with Content» и нажав кнопку «ОК»:

В открывшемся окне необходимо указать пользователя, учетные данные которого вы используете для публикации из Visual Studio:

А также в выпадающем меню Providers необходимо дополнительно выбрать пункты «createApp» и «setAcl»:

После нажатия кнопки «ОК» откроется окно добавления пользователя.
Здесь в поле «Name» можно поставить * и нажать кнопку ОК:

После выполнения данных действий, окно правил «Management Service Delegation» будет иметь следующий вид:

И описанная ошибка исчезнет.

UPDATE 19.01.2017

Если во время проверки соединения с сервером (при нажатии на кнопку «Validate Connection») возникает ошибка:
Could not connect to the remote computer ("serverName") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer...

а в конце текста ошибки написано «The remote server returned an error: (550)».

Это говорит о том, что вы опечатались в параметре «Site name» в окне настроек публикации.
Проверьте имя сайта и сравните его с тем, куда публикуете своё приложение.

When using Visual Studio 2008, when I «Publish Web Site», the application builds correctly, but then I get a «Publish failed» message:

enter image description here

What possible reasons are there for this, and how can I prevent it?

asked Nov 14, 2011 at 11:21

Curtis's user avatar

6

I had the same issue. Nightmare to identify the problem, because the logs and outputs show no errors or failures. I simply get «Build: 39 succeeded» and «Publish: 1 failed».

I resolved the problem by systematically removing all NuGet packages one at a time (and removing code that references it) until I identified the offending one.

This takes a LONG time!

However, the answer for me was Microsoft.Net.Compilers.

No idea how I ended up with that in my project, but as soon as I removed that package, everything publishes fine again.

Edit — For what it’s worth, this problem occurs on VS 2008, 2012 and 2015 but does not occur on 2017.

answered Feb 2, 2018 at 13:07

SimonGoldstone's user avatar

SimonGoldstoneSimonGoldstone

5,0223 gold badges25 silver badges37 bronze badges

8

You can try this:

  1. Perform precompilation against the web application.

  2. Clear the target directory(virtual directory in IIS or physical file
    folder) and deploy all the files (of the web application) into the target
    directory.

In the output window you can check at which stage does the publish website
operation fail. For example, at the first stage, if there are some error
which will only occur at precompilation, that will cause the stage 1 fail.
Or some times if the target directory has something configured incorrectly.
Such as the IIS virtual dir is not set to the correct ASP.NET version or
some old files are locked and prevent them from being cleared. Mostly,
publish failed will be caused by IIS side configuration issue such as
authentication setting….

Source link

You can open the output window by pressing Ctrl+W, O.

shA.t's user avatar

shA.t

16.4k5 gold badges52 silver badges111 bronze badges

answered Nov 14, 2011 at 12:56

NaveenBhat's user avatar

NaveenBhatNaveenBhat

3,2284 gold badges35 silver badges47 bronze badges

1

Sometimes it’s because you need to be running VS as Administrator to be able to write to the target directory.

Check the Output messages, they should help you solve the problem

answered May 10, 2012 at 20:04

Nick's user avatar

NickNick

3462 silver badges6 bronze badges

1

I had to copy project to C:a and than publish. I suspect problems with long path. Strange, but worked for me.

answered Jul 21, 2015 at 10:12

vt100's user avatar

vt100vt100

8731 gold badge11 silver badges21 bronze badges

2

The conclusion is: Try another VS edition and see if that does it.

Here is what did it for me.

I have VS 2013 Pro and Visual Studio 2015 Community. I sort of use one or another to work on my MVC project and all was fine. Then all of the sudden VS 2013 could not publish though it would build just fine. There was no erros other than some silly …code is not returned from all paths…

So when I open it in VS 2017 — it published the same project just fine. I am suspecting a compiling issue — be cause that was the stage it would fail at.

Hope that helps you save a bit of time.

answered Mar 19, 2018 at 1:11

Alexey Shevelyov's user avatar

1

Not sure if this happens in different versions of Visual Studio, but at least in 2015 Professional Edition, the problem arises when we try to update all Nuget packages from the solution using the Packages Manager.

As pointed out by @SimonGoldstone the issue is caused by the package «Microsoft.Net.Compilers». By default, the package gets added to the solution while creating a new web application. The default version 1.0.0 does not introduce any problems. I was able to keep testing with latest versions until 2.4.0 and everything works fine, but from 2.6.0 henceforth is when it all starts. If an update is strictly required, I would recommend updating the aforementioned package until version 2.4.0. After doing some research, seems that some bugs on later versions than 2.4.0 are introduced and not fixed on the long term. What is curious though, is how this problem gets included on Nuget with no basic quality control checkpoint.

answered Jul 16, 2018 at 20:00

Joseph L.'s user avatar

Joseph L.Joseph L.

3914 silver badges7 bronze badges

1

There are many proposed solutions for this. I think they are overcomplicating the issue.
I found the following worked for me:

  1. Locate the obj(Release or Debug) folder in your solution
  2. Inside the Release or Debug folder delete the CONTENTS of the ‘AspnetCompileMerge’ folder

Now try and publish.

answered Nov 5, 2018 at 10:43

NeilR's user avatar

NeilRNeilR

1611 gold badge1 silver badge4 bronze badges

1

Make sure you empty the target folder (manually) before publishing. Sometimes vs cant delete a file which will result in a failed publish

answered Sep 30, 2016 at 15:29

nvasquez's user avatar

After trying a Rebuild, having other Projects in my Solution able to publish correctly, and changing my publish location to the C: drive (locally attached) instead of pushing to a mapped network drive, I was still having an issue where the only error output said:

========== Build: 5 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

My solution is targeting x86, but I think during a Git Merge, this project had it’s profile switched to Any CPU. After creating an x86 profile for the project and having it match the target of the publish goal and of the active solution configuration, I was able to successfully publish again.

SHR's user avatar

SHR

7,7359 gold badges38 silver badges57 bronze badges

answered Apr 1, 2019 at 15:12

legistrate's user avatar

Check Project BIn directory. there must be a DLL of your page or control. which has to be recreated during publish. So exclude it or remove it

answered Jan 3, 2013 at 7:23

Dilshad's user avatar

1

I ran into this same problem today and it was due to the Thumbs.db file that was created when I opened my images folder to look for an image. I deleted the file and the project deployed successfully. Hope this helps someone else in the same situation.

answered Feb 25, 2016 at 20:12

Tammy Spencer's user avatar

1

Delete publish profile and create another one . Worked for me

answered May 9, 2021 at 4:01

Akbar Asghari's user avatar

In my case, I was publishing to a directory in a mapped network drive, but the Output panel/window was indicating that the location didn’t exist. The path was correct, and the drive was fully accessible. The problem resolved itself when I re-set the path to publish to in Visual Studio by using the button.

answered Jun 14, 2013 at 4:13

Sam's user avatar

SamSam

39.6k34 gold badges175 silver badges214 bronze badges

With me it was simple — the dist folder was locked. I unlocked it by an unlocker and the publishing resumed.

answered Oct 14, 2018 at 14:00

imlarry's user avatar

I have several user controls that are registered in the web.config, and have a ClassName in the .ascx file header. For normal builds everything works fine, but with a publish those class names were not recognized anymore. At some point I found out that the errors were not in my regular code files, but in copies in a temp directory for publishing.

I had «Precompile during publishing» turned on (to be found under Settings > File Publish Options). Turning that option off worked for me.

Pika Supports Ukraine's user avatar

answered Nov 16, 2018 at 17:23

macnerd's user avatar

macnerdmacnerd

1611 silver badge5 bronze badges

I had the same issue with VS2017 with a website project. Build worked, but publish gave me an error:
Error CS0012: The type 'System.Net.Http.HttpMessageHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
All my projects already had a reference to System.Net.Http so it was really confusing.

To fix it, I had to copy System.Net.Http.dll into my website project / bin folder so publish could find it and copy it to my web host. I found System.Net.Http.dll by looking at another project’s references (a class library), then System.Net.Http.dll Properties, and seeing the path (C:Program Files(x86)Reference AssembliesMicrosoftFramework.NetFrameworkv4.6System.Net.Http.dll).

answered Feb 9, 2019 at 15:57

Scott Guillaudeu's user avatar

i know iam late but i think it should use for someone whos searching for this query.

just uninstall all your nuget pakages , then clean and rebuilt solution ,
now click on publish , sure it works and u will see publishing starts and works correctly now

answered Feb 18, 2019 at 7:15

sathish v's user avatar

If any one had changed the version of the project file and related framework. then this type of issue happened.

please go to "C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVisualStudiov16.0Web" location for visual studio published and build setting -> edit -> comment the force copy of all file section.

enter image description here

Martin Brisiak's user avatar

answered Feb 11, 2021 at 10:15

Pawan Kumar's user avatar

I had one file that was not found. I had copied in a png file to replace a jpg in the content folder , same name except filetype extension.
Project built fine, but refused to build and publish . changed extension of file so it could find that file name and it worked — no errors amazing 1 thing wrong and everything else is an error.

answered Mar 31, 2022 at 16:54

Ken's user avatar

KenKen

2,3442 gold badges25 silver badges34 bronze badges

The case for me was that Visual Studio was not signed in to Azure, but provided no indication of that. I edited the publish profile, clicked «Validate Connection» then clicked «Save» and then it worked.

enter image description here

enter image description here

answered Aug 27, 2022 at 15:00

Aviad P.'s user avatar

Aviad P.Aviad P.

31.5k14 gold badges106 silver badges122 bronze badges

I was working on a feature branch, which was failing. Switched to Master Branch, deleted the feature one and created another one. It worked.

answered Nov 30, 2021 at 6:57

ispostback's user avatar

ispostbackispostback

1511 gold badge7 silver badges19 bronze badges

What caused my issue was a little different, but has similarities to some of the reasons stated above.

I managed to trash my local copy of a given application and did a GIT hard reset to get the most recent from the repository in question. This in turn, wiped out the web.config file (which was not stored in the GIT repository for various reasons).

This cause configuration information for various NuGet packages to be «lost» (since it was stored in web.config).

Fortunately, I had «backed up» the web.config, so once I figured out it was not out there (a migration failed because I was unable to connect to the database), I was able to replace it.

Tried the publish again, after fixing the web.config, and everything worked perfectly.

answered Aug 2, 2018 at 15:02

Kurt Shubert's user avatar

If you are opting for the «Delete all existing files prior to publish» in the publish web dialog box, then make sure that the Visual Studio is started with Admin rights. Right click the Visual Studio and click Run as Administrator. Hope this helps.

Zoe stands with Ukraine's user avatar

answered Apr 11, 2019 at 16:05

Sandeep Suri's user avatar

0

When using Visual Studio 2008, when I «Publish Web Site», the application builds correctly, but then I get a «Publish failed» message:

enter image description here

What possible reasons are there for this, and how can I prevent it?

asked Nov 14, 2011 at 11:21

Curtis's user avatar

6

I had the same issue. Nightmare to identify the problem, because the logs and outputs show no errors or failures. I simply get «Build: 39 succeeded» and «Publish: 1 failed».

I resolved the problem by systematically removing all NuGet packages one at a time (and removing code that references it) until I identified the offending one.

This takes a LONG time!

However, the answer for me was Microsoft.Net.Compilers.

No idea how I ended up with that in my project, but as soon as I removed that package, everything publishes fine again.

Edit — For what it’s worth, this problem occurs on VS 2008, 2012 and 2015 but does not occur on 2017.

answered Feb 2, 2018 at 13:07

SimonGoldstone's user avatar

SimonGoldstoneSimonGoldstone

5,0223 gold badges25 silver badges37 bronze badges

8

You can try this:

  1. Perform precompilation against the web application.

  2. Clear the target directory(virtual directory in IIS or physical file
    folder) and deploy all the files (of the web application) into the target
    directory.

In the output window you can check at which stage does the publish website
operation fail. For example, at the first stage, if there are some error
which will only occur at precompilation, that will cause the stage 1 fail.
Or some times if the target directory has something configured incorrectly.
Such as the IIS virtual dir is not set to the correct ASP.NET version or
some old files are locked and prevent them from being cleared. Mostly,
publish failed will be caused by IIS side configuration issue such as
authentication setting….

Source link

You can open the output window by pressing Ctrl+W, O.

shA.t's user avatar

shA.t

16.4k5 gold badges52 silver badges111 bronze badges

answered Nov 14, 2011 at 12:56

NaveenBhat's user avatar

NaveenBhatNaveenBhat

3,2284 gold badges35 silver badges47 bronze badges

1

Sometimes it’s because you need to be running VS as Administrator to be able to write to the target directory.

Check the Output messages, they should help you solve the problem

answered May 10, 2012 at 20:04

Nick's user avatar

NickNick

3462 silver badges6 bronze badges

1

I had to copy project to C:a and than publish. I suspect problems with long path. Strange, but worked for me.

answered Jul 21, 2015 at 10:12

vt100's user avatar

vt100vt100

8731 gold badge11 silver badges21 bronze badges

2

The conclusion is: Try another VS edition and see if that does it.

Here is what did it for me.

I have VS 2013 Pro and Visual Studio 2015 Community. I sort of use one or another to work on my MVC project and all was fine. Then all of the sudden VS 2013 could not publish though it would build just fine. There was no erros other than some silly …code is not returned from all paths…

So when I open it in VS 2017 — it published the same project just fine. I am suspecting a compiling issue — be cause that was the stage it would fail at.

Hope that helps you save a bit of time.

answered Mar 19, 2018 at 1:11

Alexey Shevelyov's user avatar

1

Not sure if this happens in different versions of Visual Studio, but at least in 2015 Professional Edition, the problem arises when we try to update all Nuget packages from the solution using the Packages Manager.

As pointed out by @SimonGoldstone the issue is caused by the package «Microsoft.Net.Compilers». By default, the package gets added to the solution while creating a new web application. The default version 1.0.0 does not introduce any problems. I was able to keep testing with latest versions until 2.4.0 and everything works fine, but from 2.6.0 henceforth is when it all starts. If an update is strictly required, I would recommend updating the aforementioned package until version 2.4.0. After doing some research, seems that some bugs on later versions than 2.4.0 are introduced and not fixed on the long term. What is curious though, is how this problem gets included on Nuget with no basic quality control checkpoint.

answered Jul 16, 2018 at 20:00

Joseph L.'s user avatar

Joseph L.Joseph L.

3914 silver badges7 bronze badges

1

There are many proposed solutions for this. I think they are overcomplicating the issue.
I found the following worked for me:

  1. Locate the obj(Release or Debug) folder in your solution
  2. Inside the Release or Debug folder delete the CONTENTS of the ‘AspnetCompileMerge’ folder

Now try and publish.

answered Nov 5, 2018 at 10:43

NeilR's user avatar

NeilRNeilR

1611 gold badge1 silver badge4 bronze badges

1

Make sure you empty the target folder (manually) before publishing. Sometimes vs cant delete a file which will result in a failed publish

answered Sep 30, 2016 at 15:29

nvasquez's user avatar

After trying a Rebuild, having other Projects in my Solution able to publish correctly, and changing my publish location to the C: drive (locally attached) instead of pushing to a mapped network drive, I was still having an issue where the only error output said:

========== Build: 5 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

My solution is targeting x86, but I think during a Git Merge, this project had it’s profile switched to Any CPU. After creating an x86 profile for the project and having it match the target of the publish goal and of the active solution configuration, I was able to successfully publish again.

SHR's user avatar

SHR

7,7359 gold badges38 silver badges57 bronze badges

answered Apr 1, 2019 at 15:12

legistrate's user avatar

Check Project BIn directory. there must be a DLL of your page or control. which has to be recreated during publish. So exclude it or remove it

answered Jan 3, 2013 at 7:23

Dilshad's user avatar

1

I ran into this same problem today and it was due to the Thumbs.db file that was created when I opened my images folder to look for an image. I deleted the file and the project deployed successfully. Hope this helps someone else in the same situation.

answered Feb 25, 2016 at 20:12

Tammy Spencer's user avatar

1

Delete publish profile and create another one . Worked for me

answered May 9, 2021 at 4:01

Akbar Asghari's user avatar

In my case, I was publishing to a directory in a mapped network drive, but the Output panel/window was indicating that the location didn’t exist. The path was correct, and the drive was fully accessible. The problem resolved itself when I re-set the path to publish to in Visual Studio by using the button.

answered Jun 14, 2013 at 4:13

Sam's user avatar

SamSam

39.6k34 gold badges175 silver badges214 bronze badges

With me it was simple — the dist folder was locked. I unlocked it by an unlocker and the publishing resumed.

answered Oct 14, 2018 at 14:00

imlarry's user avatar

I have several user controls that are registered in the web.config, and have a ClassName in the .ascx file header. For normal builds everything works fine, but with a publish those class names were not recognized anymore. At some point I found out that the errors were not in my regular code files, but in copies in a temp directory for publishing.

I had «Precompile during publishing» turned on (to be found under Settings > File Publish Options). Turning that option off worked for me.

Pika Supports Ukraine's user avatar

answered Nov 16, 2018 at 17:23

macnerd's user avatar

macnerdmacnerd

1611 silver badge5 bronze badges

I had the same issue with VS2017 with a website project. Build worked, but publish gave me an error:
Error CS0012: The type 'System.Net.Http.HttpMessageHandler' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
All my projects already had a reference to System.Net.Http so it was really confusing.

To fix it, I had to copy System.Net.Http.dll into my website project / bin folder so publish could find it and copy it to my web host. I found System.Net.Http.dll by looking at another project’s references (a class library), then System.Net.Http.dll Properties, and seeing the path (C:Program Files(x86)Reference AssembliesMicrosoftFramework.NetFrameworkv4.6System.Net.Http.dll).

answered Feb 9, 2019 at 15:57

Scott Guillaudeu's user avatar

i know iam late but i think it should use for someone whos searching for this query.

just uninstall all your nuget pakages , then clean and rebuilt solution ,
now click on publish , sure it works and u will see publishing starts and works correctly now

answered Feb 18, 2019 at 7:15

sathish v's user avatar

If any one had changed the version of the project file and related framework. then this type of issue happened.

please go to "C:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildMicrosoftVisualStudiov16.0Web" location for visual studio published and build setting -> edit -> comment the force copy of all file section.

enter image description here

Martin Brisiak's user avatar

answered Feb 11, 2021 at 10:15

Pawan Kumar's user avatar

I had one file that was not found. I had copied in a png file to replace a jpg in the content folder , same name except filetype extension.
Project built fine, but refused to build and publish . changed extension of file so it could find that file name and it worked — no errors amazing 1 thing wrong and everything else is an error.

answered Mar 31, 2022 at 16:54

Ken's user avatar

KenKen

2,3442 gold badges25 silver badges34 bronze badges

The case for me was that Visual Studio was not signed in to Azure, but provided no indication of that. I edited the publish profile, clicked «Validate Connection» then clicked «Save» and then it worked.

enter image description here

enter image description here

answered Aug 27, 2022 at 15:00

Aviad P.'s user avatar

Aviad P.Aviad P.

31.5k14 gold badges106 silver badges122 bronze badges

I was working on a feature branch, which was failing. Switched to Master Branch, deleted the feature one and created another one. It worked.

answered Nov 30, 2021 at 6:57

ispostback's user avatar

ispostbackispostback

1511 gold badge7 silver badges19 bronze badges

What caused my issue was a little different, but has similarities to some of the reasons stated above.

I managed to trash my local copy of a given application and did a GIT hard reset to get the most recent from the repository in question. This in turn, wiped out the web.config file (which was not stored in the GIT repository for various reasons).

This cause configuration information for various NuGet packages to be «lost» (since it was stored in web.config).

Fortunately, I had «backed up» the web.config, so once I figured out it was not out there (a migration failed because I was unable to connect to the database), I was able to replace it.

Tried the publish again, after fixing the web.config, and everything worked perfectly.

answered Aug 2, 2018 at 15:02

Kurt Shubert's user avatar

If you are opting for the «Delete all existing files prior to publish» in the publish web dialog box, then make sure that the Visual Studio is started with Admin rights. Right click the Visual Studio and click Run as Administrator. Hope this helps.

Zoe stands with Ukraine's user avatar

answered Apr 11, 2019 at 16:05

Sandeep Suri's user avatar

0

title description ms.custom ms.date ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid author ms.author manager ms.technology ms.workload

Troubleshooting errors (ClickOnce deployments)

This article describes common errors that can occur when you deploy a ClickOnce application and provides steps to resolve each problem.

SEO-VS-2020

11/04/2016

troubleshooting

Microsoft.VisualStudio.Publish.ClickOnceProvider.ErrorPrompt.UncRequired

Microsoft.VisualStudio.Publish.ClickOnceProvider.ErrorPrompt.NoInstallUrl

VB

CSharp

C++

deploying applications, ClickOnce

troubleshooting ClickOnce deployments

ClickOnce deployment, troubleshooting

22dfe8f1-8271-4708-9c25-6bbb13920ac8

mikejo5000

mikejo

jmartens

vs-ide-deployment

multiple

Troubleshoot specific errors in ClickOnce deployments

[!INCLUDE Visual Studio]
This article lists the following common errors that can occur when you deploy a [!INCLUDEndptecclick] application, and provides steps to resolve each problem.

General errors

When you try to locate an application file, nothing occurs, or XML renders in Internet Explorer, or you receive a Run or Save As dialog box

This error is likely caused by content types (also known as MIME types) not being registered correctly on the server or client.

First, make sure that the server is configured to associate the .application extension with content type «application/x-ms-application.»

If the server is configured correctly, check that the .NET Framework 2.0 is installed on your computer. If the .NET Framework 2.0 is installed, and you are still seeing this problem, try uninstalling and reinstalling the .NET Framework 2.0 to re-register the content type on the client.

Error message says, «Unable to retrieve application. Files missing in deployment» or «Application download has been interrupted, check for network errors and try again later»

This message indicates that one or more files being referenced by the [!INCLUDEndptecclick] manifests cannot be downloaded. The easiest way to debug this error is to try to download the URL that [!INCLUDEndptecclick] says it cannot download. Here are some possible causes:

  • If the log file says «(403) Forbidden» or «(404) Not found,» verify that the Web server is configured so that it does not block download of this file. For more information, see Server and Client Configuration Issues in ClickOnce Deployments.

  • If the .config file is being blocked by the server, see the section «Download error when you try to install a [!INCLUDEndptecclick] application that has a .config file» later in this article.

  • Determine whether this error occurred because the deploymentProvider URL in the deployment manifest is pointing to a different location than the URL used for activation.

  • Ensure that all files are present on the server; the [!INCLUDEndptecclick] log should tell you which file was not found.

  • See whether there are network connectivity issues; you can receive this message if your client computer went offline during the download.

Download error when you try to install a ClickOnce application that has a .config file

By default, a Visual Basic Windows-based application includes an App.config file. There will be a problem when a user tries to install from a Web server that uses Windows Server 2003, because that operating system blocks the installation of .config files for security reasons. To enable the .config file to be installed, click Use «.deploy» file extension in the Publish Options dialog box.

You also must set the content types (also known as MIME types) appropriately for .application, .manifest, and .deploy files. For more information, see your Web server documentation.

For more information, see «Windows Server 2003: Locked-Down Content Types» in Server and client configuration issues in ClickOnce deployments.

Error message: «Application is improperly formatted;» Log file contains «XML signature is invalid»

Ensure that you updated the manifest file and signed it again. Republish your application by using [!INCLUDEvsprvs] or use Mage to sign the application again.

You updated your application on the server, but the client does not download the update

This problem might be solved by completing one of the following tasks:

  • Examine the deploymentProvider URL in the deployment manifest. Ensure that you are updating the bits in the same location that deploymentProvider points to.

  • Verify the update interval in the deployment manifest. If this interval is set to a periodic interval, such as one time every six hours, [!INCLUDEndptecclick] will not scan for an update until this interval has passed. You can change the manifest to scan for an update every time that the application starts. Changing the update interval is a convenient option during development time to verify updates are being installed, but it slows down application activation.

  • Try starting the application again on the Start menu. [!INCLUDEndptecclick] may have detected the update in the background, but will prompt you to install the bits on the next activation.

During update you receive an error that has the following log entry: «The reference in the deployment does not match the identity defined in the application manifest»

This error may occur because you have manually edited the deployment and application manifests, and have caused the description of the identity of an assembly in one manifest to become out of sync with the other. The identity of an assembly consists of its name, version, culture, and public key token. Examine the identity descriptions in your manifests, and correct any differences.

First time activation from local disk or CD-ROM succeeds, but subsequent activation from Start Menu does not succeed

[!INCLUDEndptecclick] uses the Deployment Provider URL to receive updates for the application. Verify that the location that the URL is pointing to is correct.

Error: «Cannot start the application»

This error message usually indicates that there is a problem installing this application into the [!INCLUDEndptecclick] store. Either the application has an error or the store is corrupted. The log file might tell you where the error occurred.

You should do the following:

  • Verify that the identity of the deployment manifest, identity of application manifest, and identity of the main application EXE are all unique.

  • Verify that your file paths are not longer than 100 characters. If your application contains file paths that are too long, you may exceed the limitations on the maximum path you can store. Try shortening the paths and reinstall.

PrivatePath settings in application config file are not honored

To use PrivatePath (Fusion probing paths), the application must request full trust permission. Try changing the application manifest to request full trust, and then try again.

During uninstall a message appears saying, «Failed to uninstall application»

This message usually indicates that the application has already been removed or the store is corrupted. After you click OK, the Add/Remove Program entry will be removed.

During installation, a message appears that says that the platform dependencies are not installed

You are missing a prerequisite in the GAC (global assembly cache) that the application needs in order to run.

Publishing with Visual Studio

Publishing in Visual Studio fails

Ensure that you have the right to publish to the server that you are targeting. For example, if you are logged in to a terminal server computer as an ordinary user, not as an administrator, you probably will not have the rights required to publish to the local Web server.

If you are publishing with a URL, ensure that the destination computer has FrontPage Server Extensions enabled.

Error message: Unable to create the Web site ‘<site>’. The components for communicating with FrontPage Server Extensions are not installed.

Ensure that you have the Microsoft Visual Studio Web Authoring Component installed on the machine that you are publishing from. For Express users, this component is not installed by default.

Error message: Could not find file ‘Microsoft.Windows.Common-Controls, Version=6.0.0.0, Culture=*, PublicKeyToken=6595b64144ccf1df, ProcessorArchitecture=*, Type=win32’

This error message appears when you attempt to publish a WPF application with visual styles enabled. To resolve this issue, see How to: Publish a WPF Application with Visual Styles Enabled.

Using Mage

You tried to sign with a certificate in your certificate store and a received blank message box

In the Signing dialog box, you must:

  • Select Sign with a stored certificate, and

  • Select a certificate from the list; the first certificate is not the default selection.

Clicking the «Don’t Sign» button causes an exception

This issue is a known bug. All [!INCLUDEndptecclick] manifests are required to be signed. Just select one of the signing options, and then click OK.

Additional errors

The following table shows some common error messages that a client-computer user may receive when the user installs a [!INCLUDEndptecclick] application. Each error message is listed next to a description of the most probable cause for the error.

Error message Description
Application cannot be started. Contact the application publisher.

Cannot start the application. Contact the application vendor for assistance.

These are generic error messages that occur when the application cannot be started, and no other specific reason can be found. Frequently this means that the application is somehow corrupted, or that the [!INCLUDEndptecclick] store is corrupted.
Cannot continue. The application is improperly formatted. Contact the application publisher for assistance.

Application validation did not succeed. Unable to continue.

Unable to retrieve application files. Files corrupt in deployment.

One of the manifest files in the deployment is syntactically not valid, or contains a hash that cannot be reconciled with the corresponding file. This error may also indicate that the manifest embedded inside an assembly is corrupted. Re-create your deployment and recompile your application, or find and fix the errors manually in your manifests.
Cannot retrieve application. Authentication error.

Application installation did not succeed. Cannot locate applications files on the server. Contact the application publisher or your administrator for assistance.

One or more files in the deployment cannot be downloaded because you do not have permission to access them. This can be caused by a 403 Forbidden error being returned by a Web server, which may occur if one of the files in your deployment ends with an extension that makes the Web server treat it as a protected file. Also, a directory that contains one or more of the application’s files might require a username and password in order to access.
Cannot download the application. The application is missing required files. Contact the application vendor or your system administrator for assistance. One or more of the files listed in the application manifest cannot be found on the server. Check that you have uploaded all the deployment’s dependent files, and try again.
Application download did not succeed. Check your network connection, or contact your system administrator or network service provider. [!INCLUDEndptecclick] cannot establish a network connection to the server. Examine the server’s availability and the state of your network.
URLDownloadToCacheFile failed with HRESULT ‘<number>’. An error occurred trying to download ‘<file>’. If a user has set Internet Explorer Advanced Security option «Warn if changing between secure and not secure mode» on the deployment target computer, and if the setup URL of the ClickOnce application being installed is redirected from a non-secure to a secure site (or vice-versa), the installation will fail because the Internet Explorer warning interrupts it.

To resolve this error, you can do one of the following tasks:

— Clear the security option.
— Make sure the setup URL is not redirected in such a way that changes security modes.
— Remove the redirection completely and point to the actual setup URL.

An error has occurred writing to the hard disk. There might be insufficient space available on the disk. Contact the application vendor or your system administrator for assistance. This may indicate insufficient disk space for storing the application, but it may also indicate a more general I/O error when you are trying to save the application files to the drive.
Cannot start the application. There is not enough available space on the disk. The hard disk is full. Clear off space and try to run the application again.
Too many deployed activations are attempting to load at once. [!INCLUDEndptecclick] limits the number of different applications that can start at the same time. This is largely to help protect against malicious attempts to instigate denial-of-service attacks against the local [!INCLUDEndptecclick] service; users who try to start the same application repeatedly, in rapid succession, will only end up with a single instance of the application.
Shortcuts cannot be activated over the network. Shortcuts to a [!INCLUDEndptecclick] application can only be started on the local hard disk. They cannot be started by opening a URL that points to a shortcut file on a remote server.
The application is too large to run online in partial trust. Contact the application vendor or your system administrator for assistance. An application that runs in partial trust cannot be larger than half of the size of the online application quota, which by default is 250 MB.

See also

  • ClickOnce security and deployment
  • Troubleshoot ClickOnce deployments
  • Visual Studio troubleshooting
title description ms.custom ms.date ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid author ms.author manager ms.technology ms.workload

Troubleshooting errors (ClickOnce deployments)

This article describes common errors that can occur when you deploy a ClickOnce application and provides steps to resolve each problem.

SEO-VS-2020

11/04/2016

troubleshooting

Microsoft.VisualStudio.Publish.ClickOnceProvider.ErrorPrompt.UncRequired

Microsoft.VisualStudio.Publish.ClickOnceProvider.ErrorPrompt.NoInstallUrl

VB

CSharp

C++

deploying applications, ClickOnce

troubleshooting ClickOnce deployments

ClickOnce deployment, troubleshooting

22dfe8f1-8271-4708-9c25-6bbb13920ac8

mikejo5000

mikejo

jmartens

vs-ide-deployment

multiple

Troubleshoot specific errors in ClickOnce deployments

[!INCLUDE Visual Studio]
This article lists the following common errors that can occur when you deploy a [!INCLUDEndptecclick] application, and provides steps to resolve each problem.

General errors

When you try to locate an application file, nothing occurs, or XML renders in Internet Explorer, or you receive a Run or Save As dialog box

This error is likely caused by content types (also known as MIME types) not being registered correctly on the server or client.

First, make sure that the server is configured to associate the .application extension with content type «application/x-ms-application.»

If the server is configured correctly, check that the .NET Framework 2.0 is installed on your computer. If the .NET Framework 2.0 is installed, and you are still seeing this problem, try uninstalling and reinstalling the .NET Framework 2.0 to re-register the content type on the client.

Error message says, «Unable to retrieve application. Files missing in deployment» or «Application download has been interrupted, check for network errors and try again later»

This message indicates that one or more files being referenced by the [!INCLUDEndptecclick] manifests cannot be downloaded. The easiest way to debug this error is to try to download the URL that [!INCLUDEndptecclick] says it cannot download. Here are some possible causes:

  • If the log file says «(403) Forbidden» or «(404) Not found,» verify that the Web server is configured so that it does not block download of this file. For more information, see Server and Client Configuration Issues in ClickOnce Deployments.

  • If the .config file is being blocked by the server, see the section «Download error when you try to install a [!INCLUDEndptecclick] application that has a .config file» later in this article.

  • Determine whether this error occurred because the deploymentProvider URL in the deployment manifest is pointing to a different location than the URL used for activation.

  • Ensure that all files are present on the server; the [!INCLUDEndptecclick] log should tell you which file was not found.

  • See whether there are network connectivity issues; you can receive this message if your client computer went offline during the download.

Download error when you try to install a ClickOnce application that has a .config file

By default, a Visual Basic Windows-based application includes an App.config file. There will be a problem when a user tries to install from a Web server that uses Windows Server 2003, because that operating system blocks the installation of .config files for security reasons. To enable the .config file to be installed, click Use «.deploy» file extension in the Publish Options dialog box.

You also must set the content types (also known as MIME types) appropriately for .application, .manifest, and .deploy files. For more information, see your Web server documentation.

For more information, see «Windows Server 2003: Locked-Down Content Types» in Server and client configuration issues in ClickOnce deployments.

Error message: «Application is improperly formatted;» Log file contains «XML signature is invalid»

Ensure that you updated the manifest file and signed it again. Republish your application by using [!INCLUDEvsprvs] or use Mage to sign the application again.

You updated your application on the server, but the client does not download the update

This problem might be solved by completing one of the following tasks:

  • Examine the deploymentProvider URL in the deployment manifest. Ensure that you are updating the bits in the same location that deploymentProvider points to.

  • Verify the update interval in the deployment manifest. If this interval is set to a periodic interval, such as one time every six hours, [!INCLUDEndptecclick] will not scan for an update until this interval has passed. You can change the manifest to scan for an update every time that the application starts. Changing the update interval is a convenient option during development time to verify updates are being installed, but it slows down application activation.

  • Try starting the application again on the Start menu. [!INCLUDEndptecclick] may have detected the update in the background, but will prompt you to install the bits on the next activation.

During update you receive an error that has the following log entry: «The reference in the deployment does not match the identity defined in the application manifest»

This error may occur because you have manually edited the deployment and application manifests, and have caused the description of the identity of an assembly in one manifest to become out of sync with the other. The identity of an assembly consists of its name, version, culture, and public key token. Examine the identity descriptions in your manifests, and correct any differences.

First time activation from local disk or CD-ROM succeeds, but subsequent activation from Start Menu does not succeed

[!INCLUDEndptecclick] uses the Deployment Provider URL to receive updates for the application. Verify that the location that the URL is pointing to is correct.

Error: «Cannot start the application»

This error message usually indicates that there is a problem installing this application into the [!INCLUDEndptecclick] store. Either the application has an error or the store is corrupted. The log file might tell you where the error occurred.

You should do the following:

  • Verify that the identity of the deployment manifest, identity of application manifest, and identity of the main application EXE are all unique.

  • Verify that your file paths are not longer than 100 characters. If your application contains file paths that are too long, you may exceed the limitations on the maximum path you can store. Try shortening the paths and reinstall.

PrivatePath settings in application config file are not honored

To use PrivatePath (Fusion probing paths), the application must request full trust permission. Try changing the application manifest to request full trust, and then try again.

During uninstall a message appears saying, «Failed to uninstall application»

This message usually indicates that the application has already been removed or the store is corrupted. After you click OK, the Add/Remove Program entry will be removed.

During installation, a message appears that says that the platform dependencies are not installed

You are missing a prerequisite in the GAC (global assembly cache) that the application needs in order to run.

Publishing with Visual Studio

Publishing in Visual Studio fails

Ensure that you have the right to publish to the server that you are targeting. For example, if you are logged in to a terminal server computer as an ordinary user, not as an administrator, you probably will not have the rights required to publish to the local Web server.

If you are publishing with a URL, ensure that the destination computer has FrontPage Server Extensions enabled.

Error message: Unable to create the Web site ‘<site>’. The components for communicating with FrontPage Server Extensions are not installed.

Ensure that you have the Microsoft Visual Studio Web Authoring Component installed on the machine that you are publishing from. For Express users, this component is not installed by default.

Error message: Could not find file ‘Microsoft.Windows.Common-Controls, Version=6.0.0.0, Culture=*, PublicKeyToken=6595b64144ccf1df, ProcessorArchitecture=*, Type=win32’

This error message appears when you attempt to publish a WPF application with visual styles enabled. To resolve this issue, see How to: Publish a WPF Application with Visual Styles Enabled.

Using Mage

You tried to sign with a certificate in your certificate store and a received blank message box

In the Signing dialog box, you must:

  • Select Sign with a stored certificate, and

  • Select a certificate from the list; the first certificate is not the default selection.

Clicking the «Don’t Sign» button causes an exception

This issue is a known bug. All [!INCLUDEndptecclick] manifests are required to be signed. Just select one of the signing options, and then click OK.

Additional errors

The following table shows some common error messages that a client-computer user may receive when the user installs a [!INCLUDEndptecclick] application. Each error message is listed next to a description of the most probable cause for the error.

Error message Description
Application cannot be started. Contact the application publisher.

Cannot start the application. Contact the application vendor for assistance.

These are generic error messages that occur when the application cannot be started, and no other specific reason can be found. Frequently this means that the application is somehow corrupted, or that the [!INCLUDEndptecclick] store is corrupted.
Cannot continue. The application is improperly formatted. Contact the application publisher for assistance.

Application validation did not succeed. Unable to continue.

Unable to retrieve application files. Files corrupt in deployment.

One of the manifest files in the deployment is syntactically not valid, or contains a hash that cannot be reconciled with the corresponding file. This error may also indicate that the manifest embedded inside an assembly is corrupted. Re-create your deployment and recompile your application, or find and fix the errors manually in your manifests.
Cannot retrieve application. Authentication error.

Application installation did not succeed. Cannot locate applications files on the server. Contact the application publisher or your administrator for assistance.

One or more files in the deployment cannot be downloaded because you do not have permission to access them. This can be caused by a 403 Forbidden error being returned by a Web server, which may occur if one of the files in your deployment ends with an extension that makes the Web server treat it as a protected file. Also, a directory that contains one or more of the application’s files might require a username and password in order to access.
Cannot download the application. The application is missing required files. Contact the application vendor or your system administrator for assistance. One or more of the files listed in the application manifest cannot be found on the server. Check that you have uploaded all the deployment’s dependent files, and try again.
Application download did not succeed. Check your network connection, or contact your system administrator or network service provider. [!INCLUDEndptecclick] cannot establish a network connection to the server. Examine the server’s availability and the state of your network.
URLDownloadToCacheFile failed with HRESULT ‘<number>’. An error occurred trying to download ‘<file>’. If a user has set Internet Explorer Advanced Security option «Warn if changing between secure and not secure mode» on the deployment target computer, and if the setup URL of the ClickOnce application being installed is redirected from a non-secure to a secure site (or vice-versa), the installation will fail because the Internet Explorer warning interrupts it.

To resolve this error, you can do one of the following tasks:

— Clear the security option.
— Make sure the setup URL is not redirected in such a way that changes security modes.
— Remove the redirection completely and point to the actual setup URL.

An error has occurred writing to the hard disk. There might be insufficient space available on the disk. Contact the application vendor or your system administrator for assistance. This may indicate insufficient disk space for storing the application, but it may also indicate a more general I/O error when you are trying to save the application files to the drive.
Cannot start the application. There is not enough available space on the disk. The hard disk is full. Clear off space and try to run the application again.
Too many deployed activations are attempting to load at once. [!INCLUDEndptecclick] limits the number of different applications that can start at the same time. This is largely to help protect against malicious attempts to instigate denial-of-service attacks against the local [!INCLUDEndptecclick] service; users who try to start the same application repeatedly, in rapid succession, will only end up with a single instance of the application.
Shortcuts cannot be activated over the network. Shortcuts to a [!INCLUDEndptecclick] application can only be started on the local hard disk. They cannot be started by opening a URL that points to a shortcut file on a remote server.
The application is too large to run online in partial trust. Contact the application vendor or your system administrator for assistance. An application that runs in partial trust cannot be larger than half of the size of the online application quota, which by default is 250 MB.

See also

  • ClickOnce security and deployment
  • Troubleshoot ClickOnce deployments
  • Visual Studio troubleshooting

Не могу опубликовать абсолютно любой проект (даже пустой) в Visual Studio 2019 Community.
В журнале вывода такая информация:

2>------ Начало публикации: проект: Empty1, Конфигурация: Release Any CPU ------
2>Определение проектов для восстановления...
2>Не удалось загрузить индекс службы для источника https://api.nuget.org/v3/index.json.
2>  Произошла ошибка при отправке запроса.
2>  Запрос был прерван: Не удалось создать защищенный канал SSL/TLS.
========== Сборка: успешно: 1, с ошибками: 0, без изменений: 0, пропущено: 0 ==========
========== Публикация: успешно: 0, с ошибками: 1, пропущено: 0 ==========

В файле «tmp4D94.tmp» такая информация:

22.09.2021 17:05:44
System.AggregateException: Произошла одна или несколько ошибок. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.
--- Конец трассировки внутреннего стека исключений ---

В чем проблема, уважаемые пользователи?

I keep getting this insane error which makes me think VS has gone stupid rather than wiser.

Error 1 Copying file ContentImagesBrandsLenovo.png to objDebugPackagePackageTmpContentImagesBrandsLenovo.png failed. Could not find file ‘ContentImagesBrandsLenovo.png’. 0 0 PriceCompare

The error is produced when i try to publish to file system. It’s stupid that VS is looking for a file which i deleted myself and it doesn’t reside in the solution now.

Earlier too i was deleting and adding files but suddenly today the publish command has started giving errors.

In many of the other posts, i have seen people asking to open the .csproj file with notepad and remove the references to the deleted files manually. This seems very daunting as i have deleted a long list of files and added a lot of new ones.

Is there an easier way to get rid of this problem or i need to manually remove the references to deleted file. Can’t i just delete the obj folder or empty the bin directory or clean solution or something.

asked Dec 22, 2011 at 13:32

Pankaj Upadhyay's user avatar

Pankaj UpadhyayPankaj Upadhyay

12.9k24 gold badges73 silver badges104 bronze badges

You need to tell Visual Studio that you deleted the files.

Go to the project/solution folder where the files existed and remove them there.

Visual Studio assumes that since you added the file originally, it should be published. It can’t assume that you don’t want it just because it isn’t in the filesystem. Think about using source control in a team — the file may only exist in one persons’s machine, but still be needed.

This is not a difficult as you think — the files that can not be found have a semi-transparent look to them, easy enough to select these and bulk delete in Visual Studio. You can also set the project properties to display all files then select all the ones that need to be part of the project and add them in a single operation.

answered Dec 22, 2011 at 13:37

Oded's user avatar

3

This basically happens whenever we delete the contents from the folder but forget to remove from Visual studio solutions.

To Resolve this follow below steps:-

  1. Go to visual studio solution explorer and right click on the specific content
  2. exclude from project.
  3. right click and remove from visual studio solution explorer.

Hoping this will help you :)

answered May 19, 2016 at 6:36

Vikash Pandey's user avatar

Vikash PandeyVikash Pandey

5,4096 gold badges40 silver badges42 bronze badges

1

I ran into same issue because project files were added and removed so many times. Me just removed yellow marked file from visual studio solution & it worked fine for me.

answered Apr 29, 2016 at 7:20

Anjan Kant's user avatar

Anjan KantAnjan Kant

4,04040 silver badges39 bronze badges

In my case, Problem with access permissions, I run VS in Administrator mode(Run as Administrator). Did the Trick.

answered Oct 31, 2016 at 12:35

Rajesh Budithi's user avatar

1

Shows this message when you delete a file but its name still remains in the project. Locate the file shown in the message. Then delete it.

Look at the picture

answered Nov 6, 2021 at 21:17

RainyTears's user avatar

In some cases:

  • delete app folder in bin and try to re-publish

or

  • in .csproj file check if the project version is same as the version in VS project property.

answered Nov 12, 2018 at 17:28

T.Todua's user avatar

T.ToduaT.Todua

52.6k19 gold badges233 silver badges236 bronze badges

Время на прочтение
5 мин

Количество просмотров 43K

При публикации веб-приложения из Visual Studio разработчик может столкнуться с некоторыми проблемами, и не всегда текст ошибки может помочь избавиться от проблем и правильно настроить сервер.
Ниже я опишу наиболее распространенные из них.
Надеюсь, что данная статья поможет сэкономить время, большое количество которого я потратил при изучении проблем.

Давайте попробуем развернуть приложение на чистый сервер Windows 2008 R2, на котором установлена роль «Web Server (IIS)».

1. Для этого в Visual Studio (у меня Visual Studio 2012 Professional) кликаем правой мышкой на проекте и выбираем пункт меню «Publish…»
image

Откроется окно мастера публикации, в котором нужно создать профиль
image

Вводим имя профиля (я назвал профиль также, как называется мой веб-сервер — «app10») и нажимаем кнопку «ОК».
Затем заполняем поля ввода и нажимаем кнопку «Validate Connection».
image

И тут начинается самое интересное.

2. Валидация завершилась с ошибкой.
Для того, чтобы посмотреть текст ошибки, нужно щелкнуть на гиперссылке «Failed (click for details)»

3. Первая ошибка:
Could not connect to the destination computer ("app10"). On the remote computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started.)

Студия не получила ответа от сервера.
Необходимо проверить настройки веб-сервера (в моем случае он имеет доменное имя «app10»), для чего необходимо зайти в Server Manager (у меня на сервере установлена англоязычная версия Windows 2008 R2, поэтому я буду писать английский наименования пунктов меню и заголовков окон).

4. Откройте диспетчер служб IIS и выберите узел с именем машины:
image
Я скрыл имя пользователя на скриншоте.

5. В разделе «Management» нужно проверить наличие пунктов «IIS Manager Permissions», «IIS Manager Users» и «Management Service».
У меня их нет, поэтому нужно установить.
Для этого щелкните правой мышкой на пункт «Web Server (IIS)» в левой части окна «Server Manager» и выберите пункт «Add Role Services».
Откроется окно выбора роли.
В разделе «Management Tools» отметьте пункт «Management Service» и нажмите кнопку «Next».
image

В следующем окне мастера добавления роли нажмите кнопку «Install».
image

Необходимо дождаться окончания процесса добавления роли и убедиться, что все прошло успешно:
image

Закрываем окно добавления роли и опять переходим к разделу «Management» (см. пункт 5).
Необходимые нам пункты появились.
image

6. Необходимо проверить, что Брендмауэр Windows не мешает установлению соединения.
Для этого откройте оснастку «Windows Firewall with Advanced Security», которая находится в меню «Пуск» — «Administrative Tools».
Необходимо убедиться, что входящие соединения на порт 8172 разрешены.
(У меня брендмауэр вообще отключен).

7. Необходимо убедиться, что Web Management Service слушает порт 8172.
Для этого откройте в настройках сервера дважды щелкните мышкой по пункту «Management Service»
image

В открывшемся окне проверьте, что указан порт 8172, а также разрешите удаленные подключения, установив галочку «Enable remote connection».
Если не поставить эту галочку, то в мастере публикации в Visual Studio будет возникать ошибка:
Could not connect to the remote computer ("app10") using the specified process ("The Web Management Service") because the server did not respond. Make sure that the process ("The Web Management Service") is started on the destination computer. The remote server returned an error: (403) Forbidden.

Теперь нажмите кнопку «Apply» с зеленой галочкой в правой части окна надстроек.
После применения настроек нажмите там же кнопку «Start», что приведет к запуску службы.

8. Переключаемся в Visual Studio и снова нажимаем кнопку «Validate Connection» в мастере публикации.
У меня открылась ошибка сертификата, но ее можно просто игнорировать и нажать кнопку «Accept», предварительно поставив галочку «Save this certificate for future sessions of Visual Studio».

9. После этого у меня возникла ошибка 404:
Could not connect to the remote computer ("app10"). On the destination computer, make sure that Web Deploy is installed and that the required process ("The Web Management Service") is started. The remote server returned an error: (404) Not Found.

Необходимо убедиться, что установлен инструмент «Microsoft Web Deploy 2.0».
Для этого пройдите в «Пуск» — «Control Panel» — «Programs and Features» и проверьте наличие установленного продукта «Microsoft Web Deploy 2.0».
Если его нет, то скачайте его отсюда и установите на сервере.
Во время установки нужно выбрать тип установки «Custom» и выбрать для установки все пункты, предлагаемые инсталлятором:
image

Выполните установку.

После чего обновите окно «Programs and Features» и он у вас появится.
image

10. После установки «Microsoft Web Deploy 2.0» необходимо перезапустить службу «Web Management Service».
Теперь нажимаем кнопку «Validate Connection» в мастере публикации в Visual Studio и ВУАЛЯ!!!
Проверка успешно пройдена.
image

Нажимаем кнопку «Next» дважды и публикуем приложение на веб-сервер, нажав кнопку «Publish».

В завершение данной статьи хочу сказать, что наиболее информативные сообщения при возникновении ошибок во время публикации веб-приложения можно найти в файле логов IIS, который по умолчанию находится по следующему пути:
%SystemDrive%InetpublogsWMSvc
Только помните, что как и в случае с другими журналами IIS, данные не записываются в журнал сразу, так что вам, возможно, придется подождать пару минут, чтобы увидеть последние сообщения, или перезапустить службы веб-управления, чтобы сбросить данные журнала в лог-файл.

Удачи!

UPDATE 03.08.2015

Если во время проверки соединения с сервером (при нажатии на кнопку «Validate Connection») возникает ошибка:
Could not complete an operation with the specified provider ("contentPath") when connecting using the Web Management Service.


необходимо в диспетчере служб IIS выбрать узел с именем машины и дважды кликнуть левой клавишей мыши на пункте «Management Service Delegation»:

Бывает так, что пункт ‘Management Service Delegation’ отсутствует

Для устранения данной проблемы необходимо еще раз запустить инсталлер WebDeploy, выбрать пункт «Change» и доустановить компоненты.
Затем перезапускаем оснастку управления сервером и данный пункт появится.

В открывшемся окне необходимо добавить новое правило, нажав в правой верхней части на ссылку «Add Rule…» и выбрав пункт «Deploy Applications with Content» и нажав кнопку «ОК»:

В открывшемся окне необходимо указать пользователя, учетные данные которого вы используете для публикации из Visual Studio:

А также в выпадающем меню Providers необходимо дополнительно выбрать пункты «createApp» и «setAcl»:

После нажатия кнопки «ОК» откроется окно добавления пользователя.
Здесь в поле «Name» можно поставить * и нажать кнопку ОК:

После выполнения данных действий, окно правил «Management Service Delegation» будет иметь следующий вид:

И описанная ошибка исчезнет.

UPDATE 19.01.2017

Если во время проверки соединения с сервером (при нажатии на кнопку «Validate Connection») возникает ошибка:
Could not connect to the remote computer ("serverName") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer...

а в конце текста ошибки написано «The remote server returned an error: (550)».

Это говорит о том, что вы опечатались в параметре «Site name» в окне настроек публикации.
Проверьте имя сайта и сравните его с тем, куда публикуете своё приложение.

  • Remove From My Forums

 none

Ошибка при публикации проекта.

  • Вопрос

  • Здравствуйте. При публикации проекта ASP.NET MVC5 я получаю ошибку «Сбой публикации»

    Содержимое файла tmpD547.tmp:

    16.03.2018 9:46:35
    System.AggregateException: Произошла одна или несколько ошибок. ---> System.Exception: Сбой публикации из-за ошибок сборки. Дополнительную информацию см. в списке ошибок.
       --- Конец трассировки внутреннего стека исключений ---
       в System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       в System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
       в Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
       в System.Threading.Tasks.Task`1.InnerInvoke()
       в System.Threading.Tasks.Task.Execute()
    --- Конец трассировка стека из предыдущего расположения, где возникло исключение ---
       в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       в Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
    ---> (Внутреннее исключение #0) System.Exception: Сбой публикации из-за ошибок сборки. Дополнительную информацию см. в списке ошибок.<---
    
    ===================

    Версия студии 15.6.2. Подскажите пожалуйста, в чём может быть проблема?

Ответы

  • Проблему нашёл. В проект попал файл Thumbs.db. 

    • Помечено в качестве ответа

      16 марта 2018 г. 8:02

  • Ошибка при разборе xml файла строка 0 символ 0 abbyy transformer
  • Ошибка при прошивки 8045
  • Ошибка при разблокировки загрузчика xiaomi
  • Ошибка при прошивке через odin пишет fail
  • Ошибка при разблокировке загрузчика xiaomi 1004