Luuuukke.NET

Bugs, headache, lost hairs... I love IT

Could not load file or assembly 'AjaxControlToolkit Culture=neutral, PublicKeyToken=or one of its dependencies. The parameter is incorrect…

clock July 11, 2011 21:24 by author Luuuukke

Got this message,  checked all files… deleted the solution file, re-linked all projects & references… nothing was helping.

And this error suddenly came after my computer crashed (overheating, nut that’s another problem).

 

Hey, but wait…. the computer crashed while visual studio was building the solution…
The problem was easily solved by deleting asp.net framework temporary files Smile

 

image



Visual Studio 2010 crashes on exit

clock February 4, 2011 10:07 by author Luuuukke

Visual studio was consistently crashing when exiting, with 2 specifics solutions…
I had to close all documents, collapse all sub projects, and select the solution in the Solution explorer to avoid VS to crash… Steaming mad

image

 

Yesterday, I found the cause: one child class library project was set to compile in asp.Net 2.0,
while all other projects were set to compile for asp.Net 4.0…

image

 

To change the target framework of a class library project,
open its properties,
select the tab “compile”,

go to the advanced options :

image

 

And select the target network:

image

 

That’s all folks Hot smile



Visual Studio XML IntelliSense for URL Rewrite

clock December 12, 2010 17:30 by author Luuuukke

With the new IIS 7 integrated configuration model, you may want to use the add-in URL rewriting

Unfortunately, Visual Studio intellisense does not natively understand the rewrite tags...
So you need to update the schema.. See http://ruslany.net/2009/08/visual-studio-xml-intellisense-for-url-rewrite-1-1

To install this schema, you will need to execute a C# Script "cscript UpdateSchemaCache.js",

On my windows 7 , I was not able to run that script, and received the error: There is no script engine for file extension "js"

The solution is here:
http://www.winhelponline.com/articles/230/1/Error-There-is-no-script-engine-for-file-extension-when-running-js-files.html

You need to register the jscript.dll and apply and patch...

Enjoy :-)



Minify css and jss files automatically with Visual Studio Web Deployment Projects

clock August 29, 2010 16:38 by author Luuuukke

After googling for some time, i finally found the perfect solution to minify css stylesheets and javascripts .js files.
I wanted to automaticaly compress releases files when building my websites, using web deployment projects...

The solution uses the Yahoo YUI Compressor, especially the compressor for .NET release,
(see the sample web deployment project solutions in the other downloads available !)

to put it into work, edit the web deployment project as following:

add a reference to the YUI Compressor on top of your project file:

<UsingTask TaskName="CompressorTask" AssemblyFile="..\{path to the YUI Compressor}\Yahoo.Yui.Compressor.dll" />

Then add an item group to select the input css & js files, and a compressor task in the After merge event

<Target Name="AfterMerge">

<ItemGroup>
<
CssFiles Include="$(TempBuildDir)App_Themes\**\*.css;$(TempBuildDir)CSS\*.css" />
<
JavaScriptFiles Include="$(TempBuildDir)\JavaScript\*.js" />
</
ItemGroup>

<CompressorTask
CssFiles="@(CssFiles)"
DeleteCssFiles="No"
CssOutputFile="%(rootdir)%(directory)%(Filename)%(extension)"
CssCompressionType="YuiStockCompression"
JavaScriptFiles="@(JavaScriptFiles)"
ObfuscateJavaScript="FoSho"
PreserveAllSemicolons="Yeah"
DisableOptimizations="Nope"
EncodingType="Default"
DeleteJavaScriptFiles="No"
JavaScriptOutputFile="%(rootdir)%(directory)%(Filename)%(extension)"
LoggingType="ALittleBit" />

</Target>

 

More information about the MSBuild selectors, commands, ...: http://msdn.microsoft.com/en-us/library/ms171452(VS.80).aspx



Visual Studio 2010 cool features, tips & tricks...

clock August 21, 2010 10:40 by author Luuuukke

An excellent article on Visual Studio 2010 new features, and asp.NET 4 ,
a lot of tips to improve your development environment.

Personnaly i love the [tab] [tab] code snippets and the intellisense improvments,

and also, at least available, the implicit line continuation and the automatic properties

A pitty that your website needs to be in asp.NET 4 to have VB 2010 enabled,
otherwise, with say asp.NET 3.5,  it compiles in VB 9., and you get a "bla bla bla not supported in visual basic 9..." when trying to use Automatic Properties... weird Yell

 



Visual Studio Compilation Error :

clock August 5, 2010 16:55 by author Luuuukke

I was getting a lot of error when compiling a project with a custom resource provider:

The resource object with key 'xxxxx' was not found.

cause: in my resource provider, somme calls are made to HttpContext.Current...
However, at compile time, there is NO current context... bang
http://www.hanselman.com/blog/AmIRunningInDesignMode.aspx

Solution: add a test before calling the context to see if you are in compile mode..

If Not HttpContext.Current is Nothing Then...

.. End If

 

See also: http://www.west-wind.com/weblog/posts/4008.aspx



SQL Server Express failed to retrieve text for this error Reason 15105

clock August 3, 2010 22:06 by author Luuuukke

With SQL Server Express, i had 2 different databases in the App_Data folder of an application, and i was getting constant connection errors.

After googling, i tried any solution, from changing cacls on the db folder, adding users in the sql server security, database roles, to changing identity of the iis application pool, and so on...

NOTHING Worked !

Even with 1 database alone, i was getting errors if the database was opened at the same time in visual studio and by IIS...

I ended up by regrouping the 2 databases in one,
and attached it the classic way to the server through sql server management studio.

with this connection

<

add name="mydatabase" connectionString="Server={host name}\SQLExpress;Trusted_Connection=yes;Database={Database name}"></add>

 

 



Problem building your blog with a Web Deployment Project ?

clock August 3, 2010 11:10 by author Luuuukke

The problem when builiding with Visual Studio and a Web Deployment Project:

Error 8 An error occurred when merging assemblies: ILMerge.Merge: 
ERROR!!: Duplicate type 'site' found in assembly 'App_Web_ilcyydph'. 
aspnet_merge 1 1 Website_deploy

 

This comes becauses some page classes have the same name...
Seach for the duplicate name in the whole site... and rename a class...

In my case, i added all Themes from the Mega Pack in my test blog,
some masterpages inherits classes with the same name:

<%

@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="site" %>

base class: public  partial class site : System.Web.UI.MasterPage

 

Renaming classes does the trick:

<%

@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="ZZZsite" %>

public  partial class ZZZsite : System.Web.UI.MasterPage

 

Et hop online Cool



Sign in