MSD
MSD

Reputation: 322

Azure Publish giving "The Type or Namespace {x} cannot be resolved" error

I have a MVC 4 web project that I have been working on for about a year. It is currently published and running on azure in production, and has been working there for about a year. My dev machine malfunctioned and I had to replace it. After setting up my dev environment and retrieving my codebase from my repository, I made a very minor change to one of my pages (I corrected a typo, changing "teh" to "the" in the text of one of my .cshtml pages. I downloaded and imported my azure publish profile settings from:

https://windows.azure.com/download/publishprofile.aspx?wa=wsignin1.0

which seemed to correctly populate my publish dialog and I attempted to publish my correction to staging. However, when it builds prior to publish, the output window starts to show a series of "the type or namespace {x} cannot be resolved" errors. It accumulates 72 such errors for various referenced assemblies, and then it exits with "build failed".

A few seconds later all those errors disappear and if I rebuild the solution, it does not give me those errors, which ONLY appear on a pre-publish build. I can run the project in testing environment and it works fine there.

I have tried everything I can think of. Has anyone ran into this before?

Upvotes: 0

Views: 80

Answers (1)

MSD
MSD

Reputation: 322

After a week of frustration, I finally figured out what was happening. I had a email library, rebex, that I had purchased that the project used. It was installed on my original development machine, where the application was publishing correctly. The .dll file for the rebex library was incorporated into my source code so that when my new dev machine was configured and the source code restored, the .dll file was present, and worked in development mode.

However, it would not publish to production until the installation file was re-downloaded and the rebex assemblies were registered to VS2012 and the GAC.

If anyone else has this issue, check to see if you have purchased or licensed libraries that need to be properly registered.

MSD

Upvotes: 1

Related Questions