ReBuildAll Blog
Thoughts (mostly) on .NET development

Comments

Alex Re: jQuery validate and the comma decimal separator
This does not work for me :-(

Get a browser error:
Uncaught TypeError: Cannot read property 'methods' of undefined

Any idea?
Jannik Re: Running .NET threads on selected processor cores
what about the

public int ProcessorAffinity { get; set; }

must declare a body because it is not marked abstract or extern
Re: jQuery validate and the comma decimal separator
It works!

Thanks ;)
Russel Re: jQuery validate and the comma decimal separator
Thank You Very Very Much!!! I was dying for this....
Excellent Solution...Worked without a glitch !!
sandeep sharma Re: WCF service namespaces (getting rid of tempuri.org)
Hi lenardg ,
I apply the same modification in all places but my service raising an exception thats see below
project Namespace: wcfService1
Interfacce : IRebuildallService
Class : RebuildallService

when i run the my wcfservice it rais this error
if i add the service reference and discover the URI then also not service is listed.please help me on this

Well my service name was service1 earlier and i renamed it after that hope this will help to u to find the solution easily.

Server Error in '/' Application.
--------------------------------------------------------------------------------

The type 'WcfService1.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The type 'WcfService1.Service1', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.

Darren Mart Re: Serve MVC Views from a ZIP file
Great article, thank you. I'm still getting the hang of MVC3 and will hopefully leverage this article when I try to serve up partial views from a separate assembly.

My only suggestion is to tweak FileExistsInZip() so that it's not case-sensitive. The Views should really be found whether one goes to /TestZipped or /testzipped, took me a few minutes to realize why the latter wasn't returning the views.
Nikolay Popov Re: Nokia and Windows Phone
Hi Lenard,
I share your views and agree with your points, as .NET dev I'll (I may) be happy with the move to WP7, but as Nokia C7 user (Symbian ^3 device) I certainly am not happy. For me the reason for the move is money ( a lot of MSFT's). In the same time Symbian devices will continue to come to Europe for shore, as opposed to USA, so I don’t really care much, as I live in Europe – I’m Bulgarian. There is something also notable in this regard – have you seen the speed and quantity of presenting new Symbian ^3 devices, it’s so huge these days and this makes me thinking that Nokia really goes on internal Plan B, where they continue to develop new features for Symbian, which is great . I hope that they’ll do the same with MeeGo too, which from what I’ve seen and read for N9 is also great. There are no reasons to trough the baby with the water, I can’t see a reason to trough away an OS, in which you have invested may be hundreds of man years! And by the way Symbian ^3 is great – I really don’t see something missing in it in comparison to Android and iOS ( it’s true that I can compare only with Android personally - I have one, but no iOS device)
I wish Microsoft to open the doors for QT development on WP7 , although they don’t allow native apps, may be they can allow Nokia ones. This can bring a whole lot of good apps in WP7.
We’ll see :)
Best regards, Nikolay
KOT Re: Global Assembly Cache in .NET 4.0
Try:

http://www.nirsoft.net/dot_net_tools/gac_viewer.html
Re: jQuery validate and the comma decimal separator
Very usefull thanks
Fran L Re: jQuery validate and the comma decimal separator
Awesome!
It works, thanks Lenard.
James Re: Merging WSDL and XSD files
Hey Lenard,
Sorry to use your blog comment system to contact you. But I have no way to email or PM you on NotebookReview site.
I saw your post about "Anyone want Spotify invites?" and I would like to get one if possible.
Thank you. and please delete this post from your blog, no matter i can get invite or not.

from another .net developer (nice blog btw) - James
Andrej Re: ASP.NET MVC and virtual views
Have you thought about extending the code to render partial views?
Sergey Re: Serve MVC Views from a ZIP file
I see my problem.
My local IIS site - http://localhost/ZippedVirtualPathProvider
and that is why virtualPath looks like "~/ZippedVirtualPathProvider/Views/TestZipped/Complex.cshtml"
instead of "~/Views/TestZipped/Complex.cshtml"

Thanks for your response. Great article.

Lenard Gunda Re: Serve MVC Views from a ZIP file
@Sergey, have to look into that. I think it might be just a configuration thing. Which version of IIS are you trying to get this to work with?

@Marco Leo, I am not sure you can remap the location of the web.config file, especially since it contains vital information for IIS as well (if you are using IIS7 or later). While I have not confirmed this, I think that you cannot remap web.config. Have to do some digging to make sure.
Sergey Re: Serve MVC Views from a ZIP file
It seems that it doesn't work with IIS, however everything is fine with WebDev server. Do you have any thoughts what could be wrong? Thanks.
Daniel Carvalho Melo Re: jQuery validate and the comma decimal separator
Sensational!

I´m from Brazil and I searched for this kind of solution during a entire day!
I researched for Custom Binding, change the .js manually, change the Decimal fields to String and populate the Decimal on the property´s setter...
I did´t found a globalization version for this js library, so, I think this is the best solution.

At line 4 of the range validation, I suggest another change to solve validation when using "." to thousand separator:
----------
var globalizedValue = value.replace(".", "").replace(",", ".");
----------

And with we associate this with a mask, we have a nice masked and validated number and currency validation:
http://www.jquerypriceformat.com/

Thank you.




Rene Re: jQuery validate and the comma decimal separator
Hi thanks a lot for the article but in my app is not working I am using jQuery Validation Plugin 1.8.0

Do you know how to solve it in this case?
Marco Leo Re: Serve MVC Views from a ZIP file
hello @Lenardg, I found your post really interesting and I tried to implement a similar version but in my case I just wanted to Load views from another File system location outside the web-app, without zips.

Everything works almost fine :), I am having same problem with the web-config of the view. Now my application want to get the web-config in the virtual path under the web-app root instead of my Virtual path remapped root. And for same reason it can't resolve same css files too.

I hope you can help me and future people with the same problem.

Thank again for your post i found it really useful.

Marco Leo

elperucho Re: jQuery validate and the comma decimal separator
Thanks brother
I had two days with the error of the blessed coma.

lol that is the problems of Latin countries. ;-)
Lenard Gunda Re: Serve MVC Views from a ZIP file
@Tom, glad you found my post useful. I think it possible to serve views from wherever you want them to be, be it ZIP files, databases or assemblies. Although assemblies might be tricky, because they are also loaded by ASP.NET, but before loading they are copied over to the temporary asp.net files folder. I myself have not tried your approach, so I do not know if there could be some sideeffects there.

But I think your problem might be in the override of GetCacheDependency(). My implementation checks if the file was served from the .ZIP file, and then it creates the cache dependency itself, specifying the .ZIP file as the object to monitor.

I think you should there specify the .DLL file (assembly) you pulled the view out of. From the error you are getting I think you are calling the base implementation, which tries to monitor your view and fails - of course, since the view itself does not exist on disk.
Tom Re: Serve MVC Views from a ZIP file
Thank you for your post. Your approach is exactly what I'm looking for, however, I would like the virtual views to reside in a different assembly. I have a "core" assembly that gets re-used across projects. I would love to be able to put re-usable views in the "core" assembly, then use your approach to pull the views when needed. I've tweaked your process to look for views in an assembly, but it fails. I keep getting the following error:

Directory 'C:\ProjectStore\xxx\xxx\xxx.Admin\Views\Person' does not exist. Failed to start monitoring file changes.

Is it possible to pull views from a different assembly? My goal is to have a single location for re-usable views.

Thanks agian for your post and insight.
Lenard Gunda Re: jQuery validate and the comma decimal separator
Thanks for the comments @Deef, @ruben. I updated the post to reflect this change (and I also updated my code where I used this :) )

@Vince, are you sure you include the correct version of the validate .js file? MVC project template includes both the regular version and the minified version. If you modified the regular version but include the minified version (which is recommended) your modification might not take effect.
Deef Re: jQuery validate and the comma decimal separator
I agree with Ruben, you should not change the original file in this case (or any other for that matter). Very dangerous if you or someone lese upgrades/updates that file later on and forgets about that change.

One thing is obvious, the MVC team 'forgot' about everyone outside the US.
Steve Re: WCF service namespaces (getting rid of tempuri.org)
To avoid having to put the namespace information on every single DataContract, you can optionally put an overall ContractNamespace on the whole class:

[assembly:ContractNamespace("http://myservice.com/", ClrNamespace = "MyService")]

Look it up to find more examples.
Vince Re: jQuery validate and the comma decimal separator
The validate for comma's doesn't work. I replaced it in the validate javascript and it does not work.