Tuesday, March 27, 2012

How can I access “Visual Studio Conversion Wizard” for a WebSite?




I'm using this article to convert my ASP.NET 2.0 web application to an ASP.NET 4.0 application.
However, the article states that I will be prompted to change to .NET 4.0 when I open up my project/website.
As I've previously declined this dialog I'm not longer being prompted.
I've read this question which states I should click on the Properties tab of my solution, but I only have "Properties Window". Perhaps this is just for Projects/
How can I get the conversion wizard to reappear for my WebSite was the question of the moment... I looked everywhere and could not find a solution...


Update:


I haven't been able to get the Conversion Wizard to reappear, but I have been able to convert to .NET 4.0 by:
Right Clicking on my website
Selecting Property Pages
Then go to Build tab
Change Target Framework
This made all the changes to my web.config automatically just like the conversion wizard would.


Site seems to be running in 4.0 ...testing time I say.

Friday, March 16, 2012

I hear that breaking things is the best way to learn new concepts.

Anyhu, while working with SQLServerCompact, I had this issue
Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.


I wasnt sure what the issue exactly was and then realized that there was a dependency line in my web.config refereing to this assembly

 
       
       
     

I removed this dependent assembly and my scaffolded control works likea charm now..

MVC 3 Scaffolding


SO I was playing with package manager in MVC and tried to install MVCScaffolding ...

http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/ 

Has all the details I was following to the dot...

kept on getting this error and was very baffled

PM> Scaffold Controller Team
The term ‘Scaffold’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, ver
ify that the path is correct and try again.
At line:1 char:9
+ Scaffold <<<< Controller Team
+ CategoryInfo : ObjectNotFound: (Scaffold:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

I managed to solve the problem by uninstalling and reinstalling the MvcScaffolding. That didn’t work at first, but when I uninstalled it using the -RemoveDependencies switch, and then reinstalled it again, everything worked fine again.
So you can try this:
Uninstall-Package MvcScaffolding -RemoveDependencies
Install-Package MvcScaffolding

I was also told that updating the package resolves the issue though am not sure about that...

Here is the code for the bravehearted to try:

1. Enter into your package manager console “Update-Package MvcScaffolding”
2. Then restart Visual Studio

Tuesday, March 13, 2012

Marathon update

Crunch time with my training... here is my updated new and shinny plan




March

Week
Sun
Mon
Tue
Wed
Thu
Fri
Sat
22




1
4m
2
3
15m
23
4

5

6
4m
7
8m
8
4m
9

1020m
24
11

12

13
3,5m
14
8m
15
5m
16

17
12m
25
18

19

20
4m
21
9m
22
5m
23

24
18m
26
25
26
27
5m
28
9m
29
5m
30

31
14m

April


Sun
Mon
Tue
Wed
Thu
Fri
Sat
27
1

2

3
5m
4
10m
5
5m
6

7
20m
28
8

9

10
5m
11
8m
12
4m
13

14
12m
29
15

16

17
4m
18
6m
19
3m
20

21
8m
30
22

23

24
3m
25
4m
26
2m
27

28
Race Day

29
30



 




 So tired and exhausted. Cannot wait till this race is done with...

MVC woes

So, I am diligently working with MVC 3... and ran into a very simple but convoluted problem. I was working with EF "code first" model and modified my model to add some validations...

Guess what ? It stopped running after that. Kept repeating the following message:


The model backing the 'MyDBContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

Solution:
We need to update the table in Sql Server to have the additional column you added to your entitiy class.

Database.SetInitializer(new DropCreateDatabaseIfModelChanges());

This line is used for in order to allow to edit database by making changes to Model objects.Add this line in Global.asax at Application_Start() method.

Inside the Application_Start method, define the Database initializer with one among the two options.

DropCreateDatabaseAlways: This will drop and recreate the database in every application start.

DropCreateDatabaseIfModelChanges: This will drop and create the database only if the underlined model changes.

Sample code:

protected void Application_Start()
{
Database.SetInitializer(newDropCreateDatabaseIfModelChanges());

AreaRegistration.RegisterAllAreas();

RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}

Now it is working perfectly.

Note: DropCreateDatabaseIfModelChanges should only be use early on in development, never on a production machine. If you pushed to a production machine and made schema changes, you'd loose all your data.

Wednesday, November 30, 2011

Marathon training day 1

Did the 3 mile run yesterday and decided to switch around the miles a little...

Now Tuesday and Thursday would be big mile days


      Marathon Training Schedule
Week
Mon
Tue
Wed
Thur
Fri
Sat
Sun
1
Rest
5 m pace
Nov 29
3 m run
Nov 30
8
Dec 1
3 m run
Dec 2
Rest
Cross
Dec 4
2
Rest
5 m run
Dec 6
3 m run
Dec 7
9
Dec 8
3 m run
Dec 9
Rest
Cross
Dec 11
3
Rest
5 m pace
Dec 13
3 m run
Dec 14
6
Dec 15
3 m run
Dec 16
Rest
Cross
Dec 18
4
Rest
6 m pace
Dec 20
3 m run
Dec 21
11
Dec 22
3 m run
Dec 23
Rest
Cross
Dec 25
5
Rest
6 m run
Dec 27
3 m run
Dec 28
12
Dec 29
3 m run
Dec 30
Rest
Cross
Jan 1
6
Rest
6 m pace
Jan 3
3 m run
Jan 4
9
Jan 5
3 m run
Jan 6
Rest
Cross
Jan 8
7
Rest
7 m pace
Jan 10
4 m run
Jan 11
14
Jan 12
4 m run
Jan 13
Rest
Cross
Jan 14
8
Rest
7 m run
Jan 17
4 m run
Jan 18
15
Jan 19
4 m run
Jan 20
Rest
Cross
Jan 22
9
Rest
7 m pace
Jan 24
4 m run
Jan 25
Rest
4 m run
Jan 27
Rest
Half Mar
Jan 31
10
Rest
8 m pace
Jan 31
4 m run
Feb 1
17
Feb 2
4 m run
Feb 3
Rest
Cross
Feb 5
11
Rest
8 m run
Feb 7
5 m run
Feb 8
18
Feb 9
5 m run
Feb 10
Rest
Cross
Feb 12
12
Rest
8 m pace
Feb 14
5 m run
Feb 15
13
Feb 16
5 m run
Feb 17
Rest
Cross
Feb 19
13
Rest
5 m pace
Feb 21
5 m run
Feb 22
19
Feb 23
5 m run
Feb 24
Rest
Cross
Feb 26
14
Rest
8 m run
Feb 28
5 m run
Feb 29
12
March 1
5 m run
March 2
Rest
Cross
March 4
15
Rest
5 m pace
March 6
5 m run
March 7
20
March 8
5 m run
March 9
Rest
Cross
March 11
16
Rest
4 m pace
March 13
5 m run
March 14
12
March 15
5 m run
March 16
Rest
Cross
March 18
17
Rest
3 m run
March 20
4 m run
March 21
8
March 22
4 m run
March 23
Rest
Cross
March 24
18
Rest
2 m run
March 26
3 m run
March 27
2 m run
March 28
Rest
Rest
Marathon