ASP.Net publish troubleshooting

Was trying to publish to Azure Websites, but it was hanging on “Publish Started”

The Start-up project was another project, so switched it to the website and then published ok. Deliberately switched it back to see if the problem was this and the error returned.

Why Entity Framework is releasing on NuGet only – One Unicorn

Hmm

http://blog.oneunicorn.com/2012/02/11/why-entity-framework-is-releasing-on-nuget-only/

Might work with deployment.

Seems to encourage copying EntityFramework each and every time you copy the files across.

An error occurred generating a bootstrapper: Unable to begin updating resource for bin\Debug\app.publish\setup.exe with error 80070002 TESTPUBLISH

ERROR

An error occurred generating a bootstrapper: Unable to begin updating resource for bin\Debug\app.publish\setup.exe with error 80070002 TESTPUBLISH

A SOLUTION to get it to work

Untick the Prerequisites button

See also:

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/9ab9b88b-a57b-4945-9f94-e48a82ad5d8c

 

Unable to apply publish properties for item “ApplicationCode\SystemNames.xml”

Solved with thanks to:

http://stackoverflow.com/questions/9284375/unable-to-apply-publish-properties-for-item-x

“It appears that the issue is related to ClickOnce. Navigate to the project, right click on it and click on properties. Go to the Publish tab and click on Application Files. Check the ‘Show all files’ checkbox and scroll through the list of files. Eventually, you will come across the file that has a yellow exclamation point on it. This file is orphaned and needs to be removed. Right click on the file and there should be a remove option.

Now build the solution and the warning should be gone.”

Click-Once – The application binding data format is invalid

 

Remove files from %userprofile%\AppData\Local\Apps\2.0\

Deleting an ASP.Net azure hosted website using Entity Framework can potentially delete the linked database

I had a database on Azure that was being updated using Windows Forms. I then created an ASP.Net MVC application using EF to work against the same database. However I following a tutorial which used Code First

http://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/

This would not publish until I used Nu-Get to:

enable-migrations

However I think I then used code first migrations on publish. However I published the website with high credentials and wanted to change the credentials to lower. Could not see how to do this in Azure, so deleted the website. At this point the database disappeared without warning.

This is why the last posts have been about SQL Azure backup. However recovered using on-site data and re-created database.

Microsoft support helped with the ASP.Net so:

enable-migrations

Check the file created, but do not check the box on publish.

Tested by deleting the Website – This then asked if you wanted to delete the linked database. Answer: No. Database stays ok.

Reference in the manifest does not match the identity of the downloaded assembly

SOLVED

Click-once does not install presenting error message:
“Reference in the manifest does not match the identity of the downloaded assembly …exe”

This could be if the referenced project is an executable, you may find that if you change the reference from a project reference to the executable file then try this may work.
Alternatively and if possible change the referenced project to  Class Library.

UPDATE 17/02/2012
Today I have extracted a Windows Forms from a main project into a smaller executable and referenced it from the main project.
I did a few things including above and then also it did not work until I had published the smaller project and it gained a certificate. Think the error was a validation error.

Setup and Deployment Project

Project 1 requires a setup project
Add New Project > Other Project Types > Setup and Deployment > Visual Studio Installer > Setup Project

See File System Editor > Application Folder > Properties for Default Location which will start as [ProgramFilesFolder][Manufacturer]\[ProductName]

The Manufacturer is set on Setup project properties. Probably change this from Microsoft. Many other properties here also.

Next problem was :

“error reading from file … verify that the file exists and that you can access it”

Following resolved this:

http://devsac.blogspot.com/2009/02/error-reading-from-file-msi-verify-that.html

This says add permission to System for the folder with the msi file in it.

Add an assembly to the GAC

> File System on Target Machine > Right-click Add Special Folder > Global Assembly Cache Folder > Browse and add assembly here. In this case EntityFramework.dll version 4.1.0.0

This worked and program then ran on target machine. However it did not appear in the C:\Windows\Assembly as I may have expected. I guess the assembly is in the file system though. To Register it I am going to try > Select assembly > Properties > Register > vsdraCOM

Distrbuting Prerequistes

> Select Setup Project > Right-click Properties > Prerequisites