Error on using usercontrol on umbraco azure - umbraco

The user control that I am using is working perfectly on my umbraco ie installed on local machine but when I uploaded it on the azure website the user control is showing errors like these
Error reading usercontrols/MdriveReg.ascx
The following list shows the Public Properties from the Control. By checking the Properties and click the "Save Properties" button at the bottom, umbraco will create the corresponding Macro Elements.
System.Web.HttpParseException (0x80004005): Could not load type 'MdriveUmbraco.MdriveReg'. ---> System.Web.HttpParseException (0x80004005): Could not load type 'MdriveUmbraco.MdriveReg'. ---> System.Web.HttpException (0x80004005): Could not load type 'MdriveUmbraco.MdriveReg'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e)

I'm not an Azure pro, but it looks like it can't load the assembly that your user control is referencing (MdriveUmbraco.dll?).
Does this assembly exist in the bin folder of the web site? Perhaps it's in the GAC of your local machine and thus not problematic there?
Do assemblies need to be signed to run in Azure? Perhaps you need to sign it?

The Problem was that my .dll file was not loading properly so I created a new project coded it to my requirements and then I build it and placed it in to my umbraco running in windows azure it worked.
THE PROBLEM WAS WITH MY .dll FILE

Related

How to deploy ASP.NET MVC site with existing database to Azure Web Apps?

Question structure: First I give structure and configs of my ASP-MVC-4 project, then describe how I deploy my site to Azure Web Apps and finally present my error and question. My problem is related to conflicts with EF Code-First Migrations during Azure Deploy.
My ASP MVC 4 Project and configs:
I'm using Visual Studio 2015-U3. I've ASP.NET MVC 4 website. Target framework: .NET Framework 4.5. The site have its own database and works locally and interacts with database ((LocalDb)\v11.0). I was using Entity Framework Code-First approach to create and fill data.
My DB connection string in Web.config:
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=OnlineAuctionDb;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\OnlineAuctionDb.mdf" providerName="System.Data.SqlClient"/>
(it is replaced on publish, but just in case)
My DbContext class:
public partial class AuctionDataContext : DbContext
{
public AuctionDataContext() : base("DefaultConnection")
{ }
public DbSet<Auction> Auctions { get; set; }
public DbSet<Category> Categories { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<Order> Orders { get; set; }
public DbSet<Bid> Bids { get; set; }
public DbSet<ItemImage> Images { get; set; }
public DbSet<Detail> Details { get; set; }
public DbSet<DetailValue> DetailValues { get; set; }
}
I have DataContextInitializer class where I initialize all needed data.
public class DataContextInitializer : DropCreateDatabaseAlways<AuctionDataContext>
{
protected override void Seed(AuctionDataContext context)
{
***All my initializations go here
}
}
Since I'm not using plain SQL and instead use Entity Framework Code First I enabled migrations. In Configuration class and Configuration.cs file I wrote:
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
Deployment to Azure
Now I switch to deployment to Azure Web Apps. I deployed the site to Azure Web Sites through VS using Publish button.
Step-by-step:
I selected Microsoft Azure Web Apps:
Then I selected my created site auctionWeb (everything here was set up automatically):
At the next step I only selected Execute Code First Migrations. Connection string (Default Connection) was set up automatically. It was set up to:
Data Source=tcp:auction-tserver.database.windows.net,1433;Initial Catalog=OnlineAuctionDb;User Id=auctionAdmin#auction-tserver.database.windows.net;Password=mypassword
In final step I hit Publish button:
Output in browser:
I received the error:
Server Error in '/' Application.
Invalid column name 'FirstName'. Invalid column name 'LastName'. Invalid column name 'Email'. Invalid column name 'Country'. Invalid
column name 'State'. Invalid column name 'City'. Invalid column name
'Address'. Invalid column name 'PostalCode'. Invalid column name
'Phone'. Invalid column name 'Password'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin
and location of the exception can be identified using the exception
stack trace below.
Stack trace:
[SqlException (0x80131904): Invalid column name 'FirstName'.
Invalid column name 'LastName'.
Invalid column name 'Email'.
Invalid column name 'Country'.
Invalid column name 'State'.
Invalid column name 'City'.
Invalid column name 'Address'.
Invalid column name 'PostalCode'.
Invalid column name 'Phone'.
Invalid column name 'Password'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2442634
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5766568
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4162
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) +255
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) +2031
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +911
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +359
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +286
WebMatrix.Data.Database.Execute(String commandText, Object[] args) +111
WebMatrix.WebData.DatabaseWrapper.Execute(String commandText, Object[] parameters) +14
WebMatrix.WebData.SimpleMembershipProvider.CreateUserRow(IDatabase db, String userName, IDictionary`2 values) +695
WebMatrix.WebData.SimpleMembershipProvider.CreateUserAndAccount(String userName, String password, Boolean requireConfirmation, IDictionary`2 values) +65
WebMatrix.WebData.WebSecurity.CreateUserAndAccount(String userName, String password, Object propertyValues, Boolean requireConfirmationToken) +70
OnlineAuction.MvcApplication.SetSecurityOptions() +322
OnlineAuction.MvcApplication.Application_Start() +51
[HttpException (0x80004005): Invalid column name 'FirstName'.
Invalid column name 'LastName'.
Invalid column name 'Email'.
Invalid column name 'Country'.
Invalid column name 'State'.
Invalid column name 'City'.
Invalid column name 'Address'.
Invalid column name 'PostalCode'.
Invalid column name 'Phone'.
Invalid column name 'Password'.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9982013
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Invalid column name 'FirstName'.
Invalid column name 'LastName'.
Invalid column name 'Email'.
Invalid column name 'Country'.
Invalid column name 'State'.
Invalid column name 'City'.
Invalid column name 'Address'.
Invalid column name 'PostalCode'.
Invalid column name 'Phone'.
Invalid column name 'Password'.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9963380
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Question:
Why I receive the error? How to properly deploy ASP.NET MVC 4 website to Microsoft Azure Web Apps cloud when I use EF Code-first so that database and site work together. On localhost everything works.
Update 1:
When I go to settings of my database in Azure portal and open Database connection strings I see this string:
Server=tcp:auction-tserver.database.windows.net,1433;Initial Catalog=OnlineAuctionDb;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
But when I set this string (with correct login and password) to my Web App settings of connection strings I still receive the same error page.
Update 2:
In Global.asax file in Application_Start() method I had this line of code:
System.Data.Entity.Database.SetInitializer(new OnlineAuction.Models.Entities.DataContextInitializer());
Now I changed it to:
System.Data.Entity.Database.SetInitializer(new System.Data.Entity.MigrateDatabaseToLatestVersion<AuctionDataContext, Configuration>());
I moved all my initializations from DataContextInitializer class to Configuration class (Seed() method).
So my DataContextInitializer that looked like this:
public class DataContextInitializer : DropCreateDatabaseAlways<AuctionDataContext>
{
protected override void Seed(AuctionDataContext context)
{
***All my initializations go here
}
}
is no longer needed. So Configuration and DataContextInitializer classes no longer conflict.
Now, all my initializations are in Configuration class:
public class Configuration : DbMigrationsConfiguration<OnlineAuction.Models.Entities.AuctionDataContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
}
protected override void Seed(AuctionDataContext context)
{
***All my initializations go here
}
}
I also set to false AutomaticMigrationsEnabled option.
But I'm not sure what to do with checkbox Execute Code First Migrations (runs on application start) during website Publish process. Do I have to switch it off now?
I'm confused with all code-first migrations conflicts. It still doesn't work.
According to the Stack Trace you provided, I assumed that you did not migrate the DB tables correctly. Based on the source code you linked, I could reproduce your issue after I deployed the website to Azure. Here is the DB tables on my Azure SQL.
Note: Upon the screenshot, we could see that there are only two properties in Users table.
After some trials, I could deploy my website to Azure successfully. You could follow the steps below and try to find whether it could work as expected on your side.
Modify the database initialization strategy below in Application_Start as you mentioned:
System.Data.Entity.Database.SetInitializer(new System.Data.Entity.MigrateDatabaseToLatestVersion<AuctionDataContext, Configuration>());
Move the initialization in function SetSecurityOptions to the bottom of the Seed() function within the Configuration class.
Note: Since you have enabled migrations, you need to either add the pending model changes to a code-based migration or enable automatic migration to update the database. So, you need to set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration.
Result: http://bruce-chen-001.azurewebsites.net/
Additionally, please follow the tutorial provided by Russell Young for a better understanding of Code First Migrations.

Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies

I have just tried to install Glimpse.MVC5 via Nuget.
After doing that I cannot run my application.
The error says that the assembly Glimpse.AspNet cannot be loaded, but I found that the dll at C:\Users\xxx\Documents\Visual Studio 2013\Projects\yyy\zzz\packages\Glimpse.AspNet.1.8.0\lib\net45\Glimpse.AspNet.dll does exist.
The error in full is;
Server Error in '/' Application.
Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Glimpse.AspNet' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Glimpse.AspNet
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Glimpse.AspNet | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/xxx/Documents/Visual Studio 2013/Projects/yyy/zzz/zzz.yzyzyz/
LOG: Initial PrivatePath = C:\Users\xxx\Documents\Visual Studio 2013\Projects\yyy\zzz\zzz.yzyzyz\bin
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\xxx\Documents\Visual Studio 2013\Projects\yyy\zzz\zzz.yzyzyz\web.config
LOG: Using host configuration file: C:\Users\xxx\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fec53fa6/71c52709/Glimpse.AspNet.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fec53fa6/71c52709/Glimpse.AspNet/Glimpse.AspNet.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxx/Documents/Visual Studio 2013/Projects/yyy/zzz/zzz.yzyzyz/bin/Glimpse.AspNet.DLL.
LOG: Attempting download of new URL file:///C:/Users/xxx/Documents/Visual Studio 2013/Projects/yyy/zzz/zzz.yzyzyz/bin/Glimpse.AspNet/Glimpse.AspNet.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fec53fa6/71c52709/Glimpse.AspNet.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/fec53fa6/71c52709/Glimpse.AspNet/Glimpse.AspNet.EXE.
LOG: Attempting download of new URL file:///C:/Users/xxx/Documents/Visual Studio 2013/Projects/yyy/zzz/zzz.yzyzyz/bin/Glimpse.AspNet.EXE.
LOG: Attempting download of new URL file:///C:/Users/xxx/Documents/Visual Studio 2013/Projects/yyy/zzz/zzz.yzyzyz/bin/Glimpse.AspNet/Glimpse.AspNet.EXE.
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.]
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +39
System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +37
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +65
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +38
[ConfigurationErrorsException: Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.]
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase) +348
System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, Boolean checkAptcaBit) +19
System.Web.Configuration.Common.ModulesEntry.SecureGetType(String typeName, String propertyName, ConfigurationElement configElement) +39
System.Web.Configuration.Common.ModulesEntry..ctor(String name, String typeName, String propertyName, ConfigurationElement configElement) +42
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +158
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +950
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +82
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
[HttpException (0x80004005): Could not load file or assembly 'Glimpse.AspNet' or one of its dependencies. The system cannot find the file specified.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931916
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248
I found what the problem was.
After I created a new project to my application, the project I loaded Glimpse into was not building, and that is why there was a problem. When I build the project individually it works. I need to sort out my builds

RenderAction inside a View when incoming URL ends with colon throws error

Looking at my ASP MVC's ELMAH log files, I can see this error coming through quite often:
System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Web.InternalSecurityPermissions.PathDiscovery(String path)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage)
at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm)
at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter)
at System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues)
at ...\Views\Layout\_Header.cshtml:line 10
Here is the offending code:
#{Html.RenderAction("HeaderCart", "ShoppingCart", new{area = ""});}
We render a few partials from the site's layout before hitting any RenderActions -- this is the first one that's called, and throws the error.
When a particular URL (which is matched using a custom MVC Route) is called that ends in ":" then the error is thrown.
It's coming quite deep from inside MVC - any ideas how to work around this?

Web API throws error on live but runs fine in local

I am developing an web API along with webrole in a MVC-Azure app. Everything was fine before. But one of our users reported some of the API methods are returning a 500. where others does not. But it's working fine on my local.
When I checked in log, I found:
Could not load type 'myWebAPI.WebApiApplication'. at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
Could not load type 'myWebAPI.WebApiApplication'. at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) at System.Web.Compilation.BuildManager.CompileGlobalAsax() at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
Could not load type 'myWebAPI.WebApiApplication'. at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
Could not load type 'myWebAPI.WebApiApplication'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)
NOTE: The webAPI app is dependent on the webrole app.

Publish web on Azure. Operation could destabilize the runtime in MVC3

I published my web project to Azure and when I pull it up in the browser I see the error below.
I fixed the same error by disabling IntelliTrace, when I published my Web ROLE to windows azure. But I could not find where to disable it in Publish web settings.
http://www.windowsazure.com/media/devcenter/dotnet/dev-net-getting-started-039.png
[VerificationException: Operation could destabilize the runtime.]
FluentValidation.AbstractValidator`1..ctor() in c:\Projects\FluentValidation\src\FluentValidation\AbstractValidator.cs:36
Poll.Areas.Shared.Validators.Account.LogOnValidator..ctor() in D:\Code\Poll\Poll\Areas\Shared\Validators\Account\LogOnValidator.cs:15
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
System.Activator.CreateInstance(Type type) +6
FluentValidation.Internal.InstanceCache.GetOrCreateInstance(Type type, Func2 factory) in c:\Projects\FluentValidation\src\FluentValidation\Internal\InstanceCache.cs:58
FluentValidation.Internal.InstanceCache.GetOrCreateInstance(Type type) in c:\Projects\FluentValidation\src\FluentValidation\Internal\InstanceCache.cs:37
FluentValidation.Attributes.AttributedValidatorFactory.GetValidator(Type type) in c:\Projects\FluentValidation\src\FluentValidation\Attributes\AttributedValidatorFactory.cs:48
FluentValidation.Mvc.FluentValidationModelValidatorProvider.GetValidators(ModelMetadata metadata, ControllerContext context) in c:\Projects\FluentValidation\src\FluentValidation.Mvc3\FluentValidationModelValidatorProvider.cs:75
System.Web.Mvc.<>c__DisplayClass7.<GetValidators>b__6(ModelValidatorProvider provider) +21
System.Linq.<SelectManyIterator>d__142.MoveNext() +234
System.Linq.d__142.MoveNext() +397
System.Web.Mvc.HtmlHelper.GetUnobtrusiveValidationAttributes(String name, ModelMetadata metadata) +297
System.Web.Mvc.Html.InputExtensions.InputHelper(HtmlHelper htmlHelper, InputType inputType, ModelMetadata metadata, String name, Object value, Boolean useViewData, Boolean isChecked, Boolean setId, Boolean isExplicitValue, IDictionary2 htmlAttributes) +794
System.Web.Mvc.Html.InputExtensions.HiddenHelper(HtmlHelper htmlHelper, ModelMetadata metadata, Object value, Boolean useViewData, String expression, IDictionary2 htmlAttributes) +124
System.Web.Mvc.Html.InputExtensions.HiddenFor(HtmlHelper1 htmlHelper, Expression1 expression, IDictionary2 htmlAttributes) +90
System.Web.Mvc.Html.InputExtensions.HiddenFor(HtmlHelper1 htmlHelper, Expression1 expression) +54
I fixed this problem by "Enable package manager restore". Right click on solution -> Enable package manager restore
If you think it's IntelliTrace, and you've enabled it, you can disable it by:
Right click on your Cloud Project
Select Publish
Go to Settings
Advanced
(Un)check the "IntelliTrace" checkbox
This dialog is only available when you chose the "Publish" action for the context menu.
You can continue to use IntelliTrace by taking a look at the top of your exception stack and add exception module in advanced settings. Explained here.

Resources