Please help me with publishing my first Asp.Net MVC project - I'm learning as I go

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
Hi, I come from older ASP.Net versions, so the last few weeks, I've been getting up to speed with MVC and Monkeysoft Identities, ect, ect...

So the time has come to publish my first MVC Project, and I'm stuck.

Simply publishing to and FTP Site does copy the files and such but doesn't just work out of the box.
That much I expected, what I didn't expect was how little information is available on this.

First Things First...
I'm using Visual Studio Community 2015 Edition, on Windows 7, trying to publish to a .Net Domain at WebAfrica.

About the DB.. I've kept the ASP Identities tables as is. So for the additional roles I needed, I've created a seperate table linked (one way) to the AspNetUsers and AspNetRoles table. Not the most optimal setup, but practical.
(The Additional Roles is... you can be a Manager at Company1, but also a Standard User at Company2)

Anyhow.. I'm still learning as I go, and getting the hang of it. It's such a change from the old way of doing things.

So, where to start?
I'm guessing with the DB?
At the moment the SQL Db (2015, I think) has nothing.
Does MVC automatically create a db and make changes to the DB for startup and create the tables it requires on the webserver?
 

^^vampire^^

Expert Member
Joined
Feb 17, 2009
Messages
3,877
I've tried publishing to WebAfrica servers too and it doesn't work. I don't have the time and patience to troubleshoot their environment, especially when you are most likely going to have to communicate with a first year techie/email jocky that probably thinks they know it all when they don't have the slightest clue about .Net requirements and configuration.

You can start by publishing to your local IIS instance and learn what's involved with the requirements and config there. Can be quite enlightening.

Your best bet would be to either get a windows VPS, windows server or get an AWS EC2 instance. Either way you're gonna be paying a large amount on the hosting to try it out. .Net dev is not cheap but the frameworks make certain things like well managed and functional MVC a hell of a lot easier.

The alternative is to work for a company that has the infrastructure and are willing to let you mess around and learn.

I would recommend signing up for and learning AWS. You can get a free account for 1 year where they give you access to the very basic EC2 instance (server) and possibly an RDS (database server) although I'm not sure about the RDS being free. You do need a credit card to create your free account.

Good luck hope you come right.
 

Batista

Executive Member
Joined
Sep 2, 2011
Messages
7,909
Hi, I come from older ASP.Net versions, so the last few weeks, I've been getting up to speed with MVC and Monkeysoft Identities, ect, ect...

So the time has come to publish my first MVC Project, and I'm stuck.

Simply publishing to and FTP Site does copy the files and such but doesn't just work out of the box.
That much I expected, what I didn't expect was how little information is available on this.

First Things First...
I'm using Visual Studio Community 2015 Edition, on Windows 7, trying to publish to a .Net Domain at WebAfrica.

About the DB.. I've kept the ASP Identities tables as is. So for the additional roles I needed, I've created a seperate table linked (one way) to the AspNetUsers and AspNetRoles table. Not the most optimal setup, but practical.
(The Additional Roles is... you can be a Manager at Company1, but also a Standard User at Company2)

Anyhow.. I'm still learning as I go, and getting the hang of it. It's such a change from the old way of doing things.

So, where to start?
I'm guessing with the DB?
At the moment the SQL Db (2015, I think) has nothing.
Does MVC automatically create a db and make changes to the DB for startup and create the tables it requires on the webserver?

Q1 > Do you have the entire website working on your localhost? Dbs need to be setup manually.I use WAMP with MySQL for my sites and deployment to Afrihost is easy and just works.
 

gkm

Expert Member
Joined
May 10, 2005
Messages
1,519
Info on AWS free tier: https://aws.amazon.com/free/ to run your Windows server instance.

It includes a small but still pretty decent database (RDS) for a year.

AWS EC2 is a a good way to mess around, since if you break your server, you can just terminate and re-launch it. No harm done to anybody.
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
I've tried publishing to WebAfrica...

Well, I eventually managed to get it published. Took quite a few phonecalls, but the site itself is still not working. Going to try and get that sorted today.

Q1 > Do you have the entire website working on your localhost? Dbs need to be setup manually.I use WAMP with MySQL for my sites and deployment to Afrihost is easy and just works.

Yes, it works perfectly on localhost. I'll have to try that going forward, because after recreating the entire db on the remote server, it took hours of trail and error to wire it up. Eventually got the connection strings and everything working, so the site then runs on my localhost using the remote db for the data.

Publishing to the webserver still doesn't work though. But there's a list of things I need to go check today. What gets me is that this shouldnt be so complicated..

Info on AWS free tier: https://aws.amazon.com/free/ to run your Windows server instance.

It includes a small but still pretty decent database (RDS) for a year.

AWS EC2 is a a good way to mess around, since if you break your server, you can just terminate and re-launch it. No harm done to anybody.

Thank you. I've had an AWS account a few years back for a .Net on Linux experiment so that I can use Mongo DB, then forgot about it until Amazon sent me a bill for that 1st month after the free year. :O
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
Okay.. this is new.
I'm at a complete loss on what now.

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.

Source Error:


An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Source File: F:\Domains\theloya44\theloyaltycard.co.za\wwwroot\web.config Line: 28

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1085.0
 

Bryn

Doubleplusgood
Joined
Oct 29, 2010
Messages
16,894
MVC is the worst hell I've ever used. I'd rather code with an abacus.
 

Flipside

Senior Member
Joined
Apr 10, 2006
Messages
501
WebAfrica did not support Full Trust the last time I tried them, this was the response from their support (2015/05/18):

We do apologise for the delay in getting back to you.

I do know our engineers are working on implementing this with our new control panel.
However we currently do not have an ETA on when this will be be implemented.

As we would need to extensive testing which has not started as yet.

Therefore unfortunately we therefore we do not support this on our servers as yet.
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
From stackoverflow :



The current versions of ASP.NET now only support full trust.you need to find hosting provider that support Full Trust.

Also :

https://channel9.msdn.com/Forums/Te...s-in-different-trust-levels-and-allowOverride

Well, I've emailed WebAfrica. Hopefully they'll put me in touch with someone who knows this.. which would make sense for a webhosting service that explicitly offers .Net Hosting.

What other options are there? Because Afrihost has completely gone off the rails.

MVC is the worst hell I've ever used. I'd rather code with an abacus.

It's not too bad. This is my first rodeo with it, and I only chose it to see what the fuss is about. It's the data that's important, the framework and things can always be 'upgraded' and rebuilt on something better later.
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
WebAfrica did not support Full Trust the last time I tried them, this was the response from their support (2015/05/18):

Thank you for this and for adding the date. If they give me the same answer, I'll use your reference and ask them to either sort this out NOW, or give me my money back.
 

DA-LION-619

Honorary Master
Joined
Aug 22, 2009
Messages
13,777
Microsoft Dev Essentials > Azure credit for 1 year. Deploy to Azure it's easier.
 

semaphore

Honorary Master
Joined
Nov 13, 2007
Messages
15,194
MVC is the worst hell I've ever used. I'd rather code with an abacus.

I'm curious what makes it the worst hell? I mean you click create new project and write some code. If that is the worst hell, then i hate to see when you actually do something that requires less than two neurons actually firing.
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
WebAfrica did not support Full Trust the last time I tried them, this was the response from their support (2015/05/18):

Okay, I just had a long discussion over the phone with them. They run MVC 4, and .Net 4.0. Both are legacy systems, which is false advertizing and I'll be taking steps.
Anyhow, it means that Full Trust (which the newer frameworks require) isn't possible, and that's simply that.

Also, the Server Admin gave EXACTLY the same response that you quoted. And it's almost a year later.

Microsoft Dev Essentials > Azure credit for 1 year. Deploy to Azure it's easier.

That might be a viable route to go. Do you happen to know what the running costs are after the year?

I'm curious what makes it the worst hell? I mean you click create new project and write some code. If that is the worst hell, then i hate to see when you actually do something that requires less than two neurons actually firing.

:crylaugh:

I dunno what's wrong with MVC either, sure it's a MASSIVE leap from the old AspNet.Forms methods, but it's pretty nifty with some cool and powerful features. Doubt if it's the way forward in the long run of my venture, but for my prototype system it's bliss when you eventually get the hang of it (after 2 weeks of confused swearing).
 

Bryn

Doubleplusgood
Joined
Oct 29, 2010
Messages
16,894
I'm curious what makes it the worst hell? I mean you click create new project and write some code. If that is the worst hell, then i hate to see when you actually do something that requires less than two neurons actually firing.

That's not the problem. While I do think it unnecessarily complicates simple development, the real downfall is working with other people's MVC work.
 

semaphore

Honorary Master
Joined
Nov 13, 2007
Messages
15,194
That's not the problem. While I do think it unnecessarily complicates simple development, the real downfall is working with other people's MVC work.

I'll be honest, I just think you don't really know what you're doing. If you think its complicated, then well...
 

semaphore

Honorary Master
Joined
Nov 13, 2007
Messages
15,194
:crylaugh:

I dunno what's wrong with MVC either, sure it's a MASSIVE leap from the old AspNet.Forms methods, but it's pretty nifty with some cool and powerful features. Doubt if it's the way forward in the long run of my venture, but for my prototype system it's bliss when you eventually get the hang of it (after 2 weeks of confused swearing).

Then perhaps you're prototyping your app wrong, why not use something you're familiar with and then architect it properly once you know its viable.
 

[)roi(]

Executive Member
Joined
Apr 15, 2005
Messages
6,282
Then perhaps you're prototyping your app wrong, why not use something you're familiar with and then architect it properly once you know its viable.

Good advice... starting out it's always best to focus on getting the app to work... Refining, good design, etc. can be part of refactoring.
 

scudsucker

Executive Member
Joined
Oct 16, 2006
Messages
9,024
That's not the problem. While I do think it unnecessarily complicates simple development, the real downfall is working with other people's MVC work.
I'm not sure if you realise that MVC is a pattern, not a MS invention.

The ASP.NET implementations of the MVC pattern do have a lot to be desired, not least of which is the way that you are encouraged to work within the "MS way" and if you do not it gets pretty complex (other people's MVC work?)

Bit the MVC pattern (and it's relatives) really help with separating your system into simple, single-purpose pieces of code, which in turn makes your application easier to work with.
 

scudsucker

Executive Member
Joined
Oct 16, 2006
Messages
9,024
Oh. And more usefully: develop your website to the version of .NET that you intend to host on. It may "work on your machine" but unless you get your machine and the live machine specs right, it's not going to "just work" - and thats across all languages, all frameworks and all platforms.

As a beginner .NET guy I'd suggest you stay on v4 or 4.5 unless you can find hosts that support newer stuff.
 
Top