Oh! Daddy! GoDaddy’s Shared Hosting: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Tags

, , , ,


Lately, I was deploying an semantic web based application in a  Shared hosting  server in GODADDY.COM. And I was Getting the following error for one of the assembly I was using.

“System.Security.SecurityException: That assembly does not allow partially trusted callers. “

I have tried a lot of things,  but here is what you need to do:

1) Add following section in your web.config

<system.web>
   <trust level=”Full” />
</system.web>

2) In your application assembly.info.cs add  the first line below: 

[assembly: AllowPartiallyTrustedCallers]
[assembly: AssemblyTitle(“YOURASSEMBLYNAME”)]
[assembly: AssemblyDescription(“”)]
[assembly: AssemblyConfiguration(“”)]

 

My application was running on .net 4 and Godaddy hosting had IIS 7.0.

 

Hope this helps.

Advertisements

Disabling Foreign Key Constraints In a Table; Enabling them back After Schema Edit

Tags

, , , , ,


Some times we may need to change table schema but when there are Foreign Key constraints in any column of that table it won’t allow to change anything.

We can Disable Fk Constraints check while updating table, and later can enable them after we finish updating.

TO Disable all Fk check on a Table : we can use

ALTER TABLE MyTableName NOCHECK CONSTRAINT ALL

We can enable them back as :

ALTER TABLE MyTableName CHECK CONSTRAINT ALL

NB: You can also disable individual Fk in a table.

Warning: Your DB schema may become invalid after change! We have to be sure what we are changing (Schema/Data Change) and what effect it will make on DB.

Enabling Bootstrap Templates in ASP.NET Web Sites and Working With Visual Studio

Tags

, , , ,


Installing Bootstrap

The best way to install Bootstrap and working with VS would be installing it with NUGet

1. Create a new Project, (ASP.net WebForm Project)

2. Open Package Manager Console and type

PM> Install-Package Twitter.Bootstrap –Pre

image

3. All bootstrap files should now be added in in project:

image

4. Now delete other files like site.css etc that was supposed to be used in default asp.net themes.

5. Open Site.Master page and add Bootstrap min Css so that it use bootStrap css.

image

6. Save an View Page in Browser: (For Default.aspx)

image

We would also require to add following JS files :

<!– JavaScript plugins (requires jQuery) –>
   <script src=”http://code.jquery.com/jquery.js”></script>
   <!– Include all compiled plugins (below), or include individual files as needed –>
   <script src=”js/bootstrap.min.js”></script>

   <!– Optionally enable responsive features in IE8 –>
   <script src=”js/respond.js”></script>

Now we can continue to edit our template. You can continue to Getting Started .

The current release of the bootstrap is : http://blog.getbootstrap.com/2013/07/27/bootstrap-3-rc1/

 

Cheers Smile