After deploying to AppHarbor I get The type or namespace name 'WebActivator' could not be found - appharbor

I'm uploading my first application to AppHarbor and I'm getting the following error:
"The type or namespace name 'WebActivator' could not be found (are you missing a using directive or an assembly reference?)"
The solution is building correctly on the dev environment and on other build servers using MSBuild.
I couldn't find any help on the AppHarbour support page, any idea what could be happening?
Thanks

You can use the command into your nuget:
Install-Package WebActivator -version 1.5.3
EDIT
Here's a link to the nuget page.
Install-Package WebActivatorEx

I had a same problem in below code:
[assembly: WebActivator.PreApplicationStartMethod(
typeof(myApp.Web.App_Start.BreezeWebApiConfig), "RegisterBreezePreStart")]
And I found that in new versions of WebActivator its namespace is changed to WebActivatorEx; So below code solve my problem:
[assembly: WebActivatorEx.PreApplicationStartMethod(
typeof(myApp.Web.App_Start.BreezeWebApiConfig), "RegisterBreezePreStart")]

Looks like WebActivator DLL is not copied to bin folder. Make sure in VS you have Copy Local set to true and that your deployment script includes this file.
You might want to clean your local solution / deployment folder by deleting all instances of WebActivator to try to replicate the problem.

Related

The specified deps.json [] does not exist

I'm using Asp.net Core with EntityFramework.Core. I'm having troubleshot migrations and Scaffold after format my pc.
when I write these in Package Manager Console
Scaffold-DbContext "Data Source=.\SQL2017DEV;Initial Catalog=MyDataBase;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Db
Add-Migration Initial
error is
"The specified deps.json [D:\TFS\Erdi\Erdi\AspCoreWeb.Site\AspCoreWeb.Site.deps.json] does not exist"
[MyProjectFolder]\AspCoreWeb.Site.deps.json
I think it try to find my debug folder.
This solutioun is working other computers
I'm repair my visual studio but it hasn't changed
In my case; was fixed by changing the Startup Project (via Solution Properties) to the project that has EF Context file.
There is an issue with migration in VS2019. I have been facing a similar issue and was getting below error:
The specified deps.json [YourProjectLocation]\ProjectName.deps.json doesn't exists.
When I used dotnet CLI for migrations and it worked and was able to generate migration and update the same using dotnet CLI.
dotnet ef migrations add InitialCreate
dotnet ef database update
this problem generally occurs because of path issues. You should change your "outputPath" in the "project.assets.json" file.
D:\TFS\Erdi\Erdi\AspCoreWeb.Site\AspCoreWeb.Site.deps.json] instead of this,
D:\TFS\Erdi\Erdi\AspCoreWeb.Site\obj\AspCoreWeb.Site.deps.json]
i think this will resolve your problem.
If you are using Package Manager Console to "Add-Migration" or "Update-Database", be sure that the project where you want the migration is selected as the Startup project in Visual Studio and this project is also the default in Package Manager Console.
Solution Explorer:
Package Manager Console:
If you are using the dotnet CLI, then you have to navigate to the right project folder and run the migration commands from there.
Make sure that the Startup Project is where the connection string is and select the project in the Default project of Package Manager Console where the db context is at.
Just Go to VS 2022
It Worked for me
go to bin folder and copy files in it include deps.json to the path that see in error.

Error: "Assembly with name 'UnityEditor.StandardEvents' already exists (Packages/com.unity.standardevents/Editor/Editor.asmdef)"

I just updated my unity to 2018.1.0f2 and it is giving me this error:
"Assembly with name 'UnityEditor.StandardEvents' already exists (Packages/com.unity.standardevents/Editor/Editor.asmdef)"
Any idea what I should be doing to avoid this.
remove all foder in project but keep folder asset and project setting, *.sln
I got the same error, and solved it with the following steps:
Uninstall unity
Open this path
C:\Users(name of your account)\AppData\Local\Unity
Remove all folders and files
Install unity
To fix this issue:
I opened folder C:\ProgramData\Unity\cache\npm
Then inside, removed every folder other than packages.unity.com

While Installing Plugin unable to download Issue in Cordova application

When I am trying to add plugin to cordova application using config file it showing error like unable to download what will be the problem how to solve this Issuse
The problem here is the plugins was renamed with different nomenclature from the one visual studio have for example org.apache.cordova.geolocation has been renamed to cordova-plugin-geolocation.
To enable the plugins in your project you have to follow the instruccions from here:
https://github.com/Microsoft/cordova-docs/blob/master/tips-and-workarounds/general/README.md#plugin-xml
But remember to use the new plugin name.
I had the same problem and ended up adding the Plugin i wanted over the commandline with something like:
cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
Then I added it again in VS2015 and it seems to have worked fine.

System.Web.Http.GlobalConfiguration does not contain a definition for 'Configure

In global asax cs file i have this line:
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
which causes this error.
I have tried as suggested on other forums:
Open the Package Manager Console for the project with the error.
Type in Install-Package Microsoft.AspNet.WebApi.WebHost and hit Enter
Rebuild your project and all should be right with the world (or at least right with your project)
The output was:
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Core (≥ 5.2.2 && < 5.3.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.WebApi.Client (≥ 5.2.2)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.4)'.
'Microsoft.AspNet.WebApi.WebHost 5.2.2' already installed.
SM.EORD.Web already has a reference to 'Microsoft.AspNet.WebApi.WebHost 5.2.2'.
and error is still there. What could be wrong?
br, Simon
After hours of investigating i have found out that after I have installed ASP.NET Web API 2.2, the reference path of all dlls was from some old Web API - it didn't take the new ones.
The new dlls has been installed in packages folder, while the old one were in bin folder inside project.
if you want to update your references as well next time try upgrading from the package manager console you can update all or just specify the package name. Update package will upgrade vs installing a new package and you have manually go update your references.
Update-Package
In my case, the problem was that I renamed the Namespace of my project, and I did not know I needed to manually edit the namespaces section of the Views\Web.Config to match my new namespace.

Web Deploy/Publish Web site project using MsBuild.exe and command line with VS2010

I am trying to publish my project using MSBuild. I have been searching on the internet but can not forward at this stage. I am using below code
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "C:\Projects\Employee\Employee.csproj" /p:Configuration=Release /t:rebuild
This line successfully compile and deploy the project. But my web.config file is located under
obj\Release\TransformWebConfig\original
and my dlls located under
obj\Release\Package\PackageTmp
My question is how can I deploy it to a specific folder. Also I could not find organized information on the Internet with all the parameters and tutorials. Do you know where can I find?
Also I am new to MsBuild and Web Deployment. Other stackoverflow answers related to my question is higher level. Could you please explain more clearly?
If you call MS build in the following manner for instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe TestApp.csproj /p:Configuration=Release /t:Package
by specifying the target "Package" you command MS to package the website.
It will proceed to build and package your website into an MSDEPLOY package (specific zip file layout).
the output from the sample build is actually very helpful and gives you clues as to where to go next, for example it tells us where it created the file:
Package "TestApp.zip" is successfully created as single file at the following location:
file:///C:/TestApp/obj/Release/Package
It also gives us a link to find out more:
To get the instructions on how to deploy the web package please visit the following link:
http://go.microsoft.com/fwlink/?LinkId=124618
Then it shows you where it created a sample .cmd file for deploying the package
Sample script for deploying this package is generated at the following location:
C:\TestApp\obj\Release\Package\TestApp.deploy.cmd
For this sample script, you can change the deploy parameters by changing the following file:
C:\TestApp\obj\Release\Package\TestApp.SetParameters.xml
Done Building Project "C:\TestApp\TestApp.csproj" (Package target(s)).
this should get you started in creating and executing happy deployments.

Resources