When deploying mvc project with web reference in class library I see blank page - asp.net-mvc-4

Hello I've got a mvc4 project with a web reference in a class library (Total two projects in my soluition).
SO what I've done so far to publish this project to my Windoiws 2008 r2 SERVER:
I give right - click only on my mvc web project -> Publish -> As publish method I choose -> file system -> and I give the physical path of the folder where i want to publish.
Then in my Internet Informatiobn Services Manager - > i give new Site and I bind this site with the physical folder I've created
So my problem is that when I start the site I see just one blank page and nothing in it. So I have no clue for any excception.
Keep in mind that before trying to upload this project I've created one simple mvc project (without class library whith only one index action that returns simple view with hello world message) and I had no problem deploying that site. What may be the problem? THANK YOU SO MUCH IN ADVANCE. I'm stuch with this for two days.

1.check Application pool select ASP.NET v4.0 Classic then tray.

Related

Hangfire shared dashboard

.Net Core 2.2
Hangfire.Core 1.6.22
Hangfire.SqlServer 1.6.22
Hangfire 1.6.22
I have created a sample proof of concept for using Hangfire for multiple applications (2 console applications) but with a shared database and dashboard (a separate web app). It works wonderfully except that the dashboard shows either "could not load file or assembly" or "Can not find the target method" on the list of succeeded jobs.
Everything succeeds so that is good, but the dashboard is unable to display the name/description of the job without having a reference to the application dll where the job method is.
Is there a way to specify the job name/description instead of requiring the dashboard to have a reference to the application dll just to retrieve this name/description? I tried using the DisplayName attribute but that doesn't work either. If I reference the application project from the dashboard project then it works OK, but I really do not want to have to reference every project from the dashboard project just to populate this description.

ASP.NET Web API 2 continues to start even though it is not the startup project in VS 2017

In my solution, I have two projects: an WPF application and an ASP.NET Web API 2 created using the defaults. Under the API Properties - Web tab, I'm using IIS Express.
On the Solution Property Pages, I have Single startup project checked, with the WPF project selected. I can confirm this is the startup project because the WPF application is bolded in Solution Explorer. I've verified none of the IIS Express sites are running in the task tray.
When I hit F5, both the WPF and the Web API start running.
Is there a setting I'm missing somewhere? Why is the Web API starting despite not being the startup project?
In Visual Studio 2017, navigate to View > Properties Window. Then click the Web API project name in Solution Explorer, and set the Properties window's Always Start When Debugging option to False.

How to make use of common files across projects using an IIS7 virtual directory

The scenario:
I'm very new to ASP.Net MVC programming and running into a wall constantly trying to make use of common files (.js, .css) across multiple projects.
The idea is to have these generic files in 1 location which provides for easy future updates and avoids the "copy and paste" dilemma across all the projects. I've set this folder up in IIS7 as a virtual directory in the default website with an alias "CommonFiles".
The problem:
With MVC-4 I'm trying to add the js files to a script bundle but upon running the application it's not picking the files up at all. (checked in the page source and also added a js function as a test)
Code snippet in BundleConfig.cs:
bundles.Add(new ScriptBundle("~/bundles/test").Include("~/CommonFiles/test.js"));
Rendering in _Layout.cshtml:
#Scripts.Render("~/bundles/test")
I've read quite a few posts (
Script Bundling in WebForms with Virtual Directories (asp webforms though), How to add reference to System.Web.Optimization for MVC-3-converted-to-4 app, ScriptBundle not rendering scripts that are in a VirtualDirectory) but i'm afraid my lack of knowledge on MVC is limiting my path forward and really hoping to get some insight into how MVC handles IIS virtual directories and if it's even an easy possibility given the last post i've read above.
Can this be done in MVC-4 and if not what is a second best alternative in reusing common code across projects?
After reading a post by kev (Using ServerManager to create Application within Application) it put me on the right path and the issue I had is actually embarrassing.
For the sake of other devs landing on this post with a similar issue in visual studio, this is what fixed my issue:
Problem:
I make use of a separate project which contains files that are used across multiple other projects. I created a virtual folder in IIS7 referencing these files. This means if a change is needed to the common files, it's updated once and all the other projects will automatically "see" the change.
My other individual projects make use of script bundling to include files relevant only to the said project, but also to reference the common files in the virtual folder as defined in IIS.
My MVC-4 web application wasn't picking up the common files given the syntax above, in neither debug or release..
Solution:
When developing in VS2012, under the project's properties, there's a setting under the web tab where you can specify whether you want to use local IIS web server or IIS Express to test your application. IIS Express adds a random port to the site in order to test, and to allow multiple instances of sites to run (on different ports). This seems to throw the virtual directory include off in the bundling.
Choosing to use the local IIS server is closer to what the "live" environment would be in my opinion. Just un-tick the "Use IIS Express" setting.
As a side note and for more info on what the difference between the usage of IIS and IIS express is and whether it's suitable for your environment (as it was for mine) see this link:
http://msdn.microsoft.com/en-us/library/58wxa9w5.aspx
Hope this helps someone in future and saves them the amount of time I wasted on this!

How to deploy a web site on IIS by using .dll file

I want to deploy on IIS my web site but I do not want to take whole project. I just need to take .dll file. Is their any way to do so.
I do not want to use visual studio only .dll file from the project to deploy.
The basic steps for deploying to IIS on windows server are as follows:
log onto the machine that is or will be hosting your application.
Use IIS Manager to create a new website for your application.
Create a new application in that site. I believe this also will automatically create an application pool with the same name for you and use it by default.
Specify the virtual directory for your application. This is going to tell IIS where to look for your mvc application. For this case lets assume it is C:\myApp
On your own machine Build the application however you build it with the correct solution configuration (i.e. Release mode). Let say the result of your build is located at C:\MyProject\bin
Copy C:\MyProject\bin from your machine onto your hosting machine at C:\myApp
You should be able to search these steps and find a step by step guide of how to accomplish them. Here is a link to some info on what sites, applications and app pools are to help you better understand.
http://www.iis.net/learn/get-started/planning-your-iis-architecture/understanding-sites-applications-and-virtual-directories-on-iis
Based on your sites requirements there will be some additional steps to set up security and alter bindings if you need to change them.
You don't need to deploy your entire website if you only make a change in a single assembly. You could copy the .DLL assembly directly to the bin folder of your website. This will trigger the Application Pool to be recycled in IIS and the changes will be taken into effect on the next request.

Monotouch Web Reference Namespace Issue

I have an ASP.net web service sitting on a server, and I have verified that it works properly via a small test client app in VS.
I went to add it in MonoDevelop to my MT application, (Trying both the ASP.net 2.0 and WCF declarations). Inside the "Add Web Reference" wizard, it finds the web service fine. But when I go to reference it, the app doesn't know it exists.
I went to look at it, and it seems when adding it, the namespace it's assigning to it is the title of my solution (which has spaces in it), but the namespace for each of my .cs files within my app contains no spaces.
Web Service Namespace (that it wont let me change): Ultimate GameDay 2011
MT Application Namespace: UltimateGameday2011.
So I manually went into the reference.cs file and took out the spaces. The app classes then saw my web reference object, but it still won't allow me to access any of its members.
Any help would be greatly appreciated.
Check out the following link http://merbla.blogspot.com/2011/03/monotouch-with-json-using-aspnet-mvc.html
Its not a fix to your problem rather a method of creating web services that MonoTouch more easily works with. In my experience ASMX and WCF services have been problematic when consuming in a Monotouch app.
If all else fails, try using the Silverlight service utility located in your programs folder
e.g. C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Tools\SlSvcUtil.exe