I have an application which uses IIS Server Express. I want it to use IIS on my pc.
My application is working with IIS Server Express perfectly but when I try to host on IIS I get th following error message:
"Migrations is enabled for context 'PSTContext' but the database does not exist or contains no mapped tables. Use Migrations to create the database and its tables, for example by running the 'Update-Database' command from the Package Manager Console."
Anybody can help me?
Related
I am working on an ASP.NET MVC application, recently we are given IIS 8 server (Windows Server 2012) and database server with SQL Server 2012. Now application sits on my local machine, talking to the SQL Server database works perfectly.
But when I deploy the application to IIS and run the app and try to let it talk to that database ... it does not and getting following warning
The remote host does not have the dbDacFx Web Deploy provider installed, which is required for database publishing. To learn more about this visit this link.
I succesffuly deployed an MVC 4 application to IIS Express on my development machine and everything runs fine. I can also successfully deploy to my production server, but when trying to access the deployed application in the production envioronment it can't be displayed.
Development tool: Visual Studio 2012 Express for Web.
Production server (all updates installed):
- Windows Server 2008 R2 x64
- IIS 7.5
- MS .Net Framework 4.5
- ASP.Net MVC 4 with language pack
- Web Deploy 2.1 and Web Deploy 3.0
- Recommended configuration for IIS.
Furthermore, ASP.NET is registered with IIS for Framework\v4.0.30319 and Framwork64\v4.0.30319 and the application pool of the site is .Net Framework v4.0.30319. The IIS_IUSRS group has inherited permissions (Read & Execute, List Folder Contents and Read).
I have a production web server tied to the web via DynDNS, my site uses port 80.
What could be the cause for the site running but not displaying?
Any help would be appreciated.
Additional info: When I check the compatibility in WebMatrix of any site deployed to the production server I always get the result "Not available" for a Simple HTML-Page (the .Net-Framework-Version on the other hand always gives "Available").
It seems that everything is ok, I had a DNS-Server error (wrong external server address).
I am developing an ASP.NET MVC 4.5 application in C#. It works flawlessly when I run it after compiling on my local IIS Express.
However, when I try to upload it to a remote server it does not seem to recognize anything in its root directory. It only displays the default welcome screen.
I have tried reconfiguring the web.config file to point to Global.asax file, without any success. I am able to load single images by modifying the URL according to the sites structure.
What is the initial "starting file" on ASP.NET MVC 4.5 and how do I configure IIS7 to load it?
Check you server configuration (if possible), first enable Web Server (IIS) role (is posible to add from Server Manager or PowerShell), then install .NET Framework, or use aspnet_regiis.exe from .net framework folder (C:\Windows\Microsoft.NET\Framework\v4.0.30319 and C:\Windows\Microsoft.NET\Framework64\v4.0.30319) if server has configured iis web role and .net framework installed but configured incorrectly. If unsure what role features to add use Web PI and add IIS Recommended Configuration (http://www.microsoft.com/web/downloads/platform.aspx)
Note: In Visual Studio 2012 project template for MVC 4 Web Application references as copy-local MVC Assemblies from NuGet and therefor you don't need to install MVC 4 on web server.
Command to register current .NET version (from folder wich you are executing this utility, execute for both, first for 32-bit and than for 64-bit on 64-bit OS) with IIS:
aspnet_regiis -i
PowerShell to add Web Server role:
PS> Import-Module ServerManager
PS> Add-WindowsFeature Web-Server
If you see the default IIS welcome screen then it's probably because of incorrect website bindings (IP:port:hostheader). Whenever IIS cannot locate a website with specific binding it falls request back to "Default Web Site" with *:80 binding which you probably observe.
I'm new to Web API Applications. I created my very first application with only one simple Controller with only one Get() method that returns a List.
In my PC it works fine. Even after I publish the solution and access it via my IIS 7.5, the results are ok: I access
http://localhost/Application/api/Controller
and I get the answer I expect.
So I moved forward to the next step: deploying it to another server so other people in my office can access it. The server we use runs a Windows 2008 server. What I did was to simply copy the Publish folder generated by the publish command in Visual Studio 2012, and paste it in the inetpub\wwwroot folder in the server computer. Then, I accessed the IIS 7.5 that's running on the server and created a new application using the .NET 4.0 Application Pool, using the Publish folder as its physical path (exact same steps I did in my PC to publish it to my IIS).
The problem: when I try to access the application in the server machine (that's running windows 2008 server), I get the 404 error. It seems like it tries to find a physical path Application\api\Controller, insted of resolving it logically like my machine does.
I did try all the different solutions I found in the web:
I did enable all verbs in the ExtensionlessUrl-Integrated-4.0 under the mappings configuration for the Application in the IIS.
I did add the WebApiConfig.Register(GlobalConfiguration.Configuration); in my global asax.
What I noticed is that my machine has the .NET Framework 4.5 installed and the server machine only has the 4.0 framework (client and extended). But I get the same error even after compiling the application targetting the 4.0 framework.
The only MVC .dll I have in my bin directory is the System.Web.Mvc.dll... do I need any other DLL?
Thanks in advance.
Try this:
<system.webServer>
.....
<modules runAllManagedModulesForAllRequests="true" />
.....
</system.webServer>
I've an asp.net MVC website which use somme DLL that work only in 32 bits or only in 64 bits(sql lite).
Since our server are running in 64 bits, I would like to run all my code in 64 bits. The problem is that the Visual studio development server is running in 32 bits in all case.
So I come to use a Local IIS Web server.
The problem is that with an asp.net MVC website, it's mandatory to have the website at the root of the URL.
So I wish to have something like "mywebsite.lo"(with a entry in my hosts file) or "localhost:9999" as project url.
But if I try to put this, when I create the virtual directory, I got this error:
Unable to create the virtual directory. Could not find the server 'mywebsite.lo' on the local machine. Creating a virtual directory is only supported on the local IIS server.
So I created myself the website with the correct binding responding to 'mywebsite.lo'. Now if I click on Create Virtual Directory, I got a successfull message. If But when I run the website, I got a message saying : Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
In order to debug in visual studio with a local IIS, then Visual Studio must be running as an administrator, are you doing that?
I made a dummy mistake: The application pool was in .Net 2.x :/