Deployment of code first project to azure (Multiple projects) - c#

We are building a solution with 3 projects.
MVC
API
DAL
The DbContext class is located inside the DAL project.
Migrations have been successfully enabled on DAL project.
Everything works fine locally.
When trying to deploy on azure the MVC project the
Execute Code First Migrations checkbox is missing.
It seems that somehow our project is not recognized as a code first project (Publishing profile is DbDacFx instead of DbCodeFirst). After trying several solutions we tried creating the projects from the beggining and adding the files one by one checking for the checkbox each time.
The checkbox disappeared after we added a class that inherits from FlowMetaData class from Google Analytics SDK.
Is it possible that a third party library could cause such an issue ?
Or maybe something else if forcing Visual Studio (2013) to not show the checkbox ?

Related

Fix .net core error when pulling from git repo

So I made a .net core web api project and pushed it to a git repo. After pulling down the repo and attempting to run the IIS express server locally, I'm getting the error
Unable to run your project. The "RunCommand" property is not defined.
If I create a new web api project on this computer, it works fine. So it's only the project that I've pulled from git that won't work. Is there some command I need to run to make it...I don't know, update for this computer?
I've done almost nothing to this project. I added one new controller and that's it. Everything else is the default project settings.
The exact project is:
Templates -> .NET Core -> ASP.Net Core Web Application
.NET Framework 4.5.2
Edit: I've compared the new project I created with the one I cloned and everything looks the same. So I'm baffled.
Make sure that the OutputType of the project is set to Exe and that the project file starts with <Project Sdk="Microsoft.NET.Sdk.Web">.
Both are important to give VS:
The command to run when executing the project
Turn on the capabilities to generate and use a Properties/launchSettings.json file.
If your app doesn't launch, i suggest deleting a Web.config file (if exists) and Properties/launchSettings.json, then re-open the solution.
I needed to delete the
bin, obj, and .vs directories.
I just need to ignore those directories with gitignore and I won't have this issue anymore.

MSB1003 when building ASP with Jenkins

I am using Jenkins as a Windows Service with MSBuild to try and build an ASP project, but I get the following error after Jenkins have fetched all the source files from TFS:
MSBUILD : error MSB1003: Specify a project or solution file. The
current working directory does not contain a project or solution
file.
I have 3 projects in my solution. One that is ASP, one that is C# only and one that is a Database project. I have already set in my Solution that the ASP project should be the startup one but I guess I need to include the information somewhere else?
I don't quite understand where it wants me to set the project or solution file to make this work ._.
I have other projects from Colleagues at work as well whose projects are compiled and analyzed just fine. One of them is a heavy ASP.NET and Sharepoint project so not sure what gives.

Deploying web site to Azure as well as class library

I am trying to deploy an ASP.NET MVC 4 Website to Azure. In my solution I have two projects: The MVC project which contains folders for views, controllers, jQuery, CSS etc. The other project is a class library which contains all of the models such as data models, viewmodels and migration settings for Entity Framework.
I've published the first project (the MVC website) to Azure with no problems but of course it can't function without the class library. There is no option to publish the class library when I right click on it.
How do I publish the class library as well so the MVC project in Azure has access to it.
Here's an image showing my solution (project name redacted):
If you have the dependencys of the MVC Project right, using VS to deploy (by publish profile) it will automatically upload all the dependent projects of the main project you want to deploy.
It's one of the thinks that you must say that it just works
1.Expand the References
2.Right Click the reference whatever you want
3.select properties on right click
4.In Properties pane Focus on Copy Local
5.set true.
Then Publish Your Solution. that automatically publish your dll

asp.net application with multiple projects cannot load type of page code

I have a ASP.Net application that uses multiple web projects. It is set up to conform to the way Microsoft says to do this. To be clear there is one solution with multiple web project where one serves as the base project and the others are children.
I have it all working pretty well. Recently I took out a VB project and replaced it with a C# project. Now in that project whenever I try to load a page under the base project it says that it cannot load the type like what is discussed here: http://support.microsoft.com/kb/306155
When you just browse the web form from the project though (not run the solution for debugging) you do not get this error.
Any ideas?
It sounds like you may have just broken a reference in the main project. Whenever you remove a project that is referenced by project, it automatically removes it as a dependency wherever it's used.

Publish Asp.Net Solution

I have a solution, Asp.Net web application and inside the solution I have two projects. One contains VB code that handles the UI. forms etc. and the other one C# that basically uses Linq-to-Entity to handle my data. When I run the project from my local computer it works good. Now, to publish, I notice only when the UI Project is selected, the publish option is enabled. Why is that? If I publish this, would the other project not be published? Another question, I have XML files created in app_data folder, when I publish it, will I be able to access it?
Publishing only applies to web projects. If you've included a reference to the other project in your web project, it will be compiled and the DLL will be published along with your web project. Your XML files should be published along with your web project, if they aren't check their properties and make sure they are set to be published with the project (build action set to Content and Copy Always or Copy if newer is selected).
You have two projects inside your solution. One is web project and the next will be a Class Library project. All the codes related to Entity framework, LINQ queries, Database transactions, etc should be in the class library project. while building the class library it will automatically generate the DLL files. then you need only add a reference to the web project file. Then you will get all the classes, methods etc from the class library. there is no need for publishing the class library project. Because you have add the dll reference to your webproject. all the code file inside your App_Code folder shuold be converted to dll while publishing the web project. so dont worry about the files inside the App_code folder data.
Thank you
You dont need to publish reference projects individually or even the whole solution. It works simply by referencing the dll of your other project.
Both projects need to be compiled if not already
If your UI project has reference to dll from data layer project it will be published with your UI project.
You can publish it locally in another folder and test using iis express or your local iis and then publish it online with database. Update connection string and it should work if setup correct.

Categories

Resources