It's Friday so I'm prob doing something stupid here. In fact I'd put money on it.
I'm playing around with Subsonic - got my feet happily into v2.2 but intrigued by v3 alpha
Followed Rob's webcast, did as he did, watched T4 generate the code, went to use the new namespace and oh. No namespace.
I can see the namespace Test.Data in each of the generated .cs files, the tt files are included in the project as is subsonic.dll, there are no errors (I managed to get rid of a warning for the duplicate directives) but I just can't see the namespace.
To test it out I am building a simple vb.net console application so wondering if there is a conflict there. Using v2.2 against the same db works fine.
Ready for you to point and laugh.
Thanks
Yep, as I thought, me being a Friday n00b.
Didn't realise until now that you can't have vb.net and c# code co-existing in anything other than a asp.net project.
Will split into separate assemblies and go from there.
"Nothing to see here, please move along.."
Have a good weekend.
Ed
Related
I am pretty new to C# but I have worked a little bit for my classes. When I worked in C#for classes, our teacher used to tell us the namespaces that we needed for completing the assignment.
I wanted to know where do I find all the collection of the namespace for C#.
One of my friends directed me to this site
https://learn.microsoft.com/en-us/dotnet/api/index?view=netframework-4.0
but some of the namespaces did not work for example,
enter image description here
I am working on a small project with ASP.NET MVC and wanted to try different namespaces
I think you may be a little confused, or are possibly not asking the question correctly. The link you provided does contain a list of the different libraries (namespaces) available in the C# API.
If you try to use a namespace in your own code, and it does not resolve, you may need to add an assembly reference to bring that namespace into your project. VS usually does a pretty decent job of guessing what assembly, or missing using statement is required if you either press alt+enter, or click the context drop down under the missing library (denoted by the red squiggly).
Either way, you should just start coding your MVC project, and then google the issues you come up with directly. Asking for all the namespaces is very very vague.
So I have a C# (asp.net) based dashboard for a proprietary content management system. One of the things that the dashboard allows is for the user to go in and add custom css/sass to their site. When they do this, my controller calls a program that compiles the sass using NSass.Core.
Up until now, I have been using Foundation 5 as my responsive framework. Yesterday when attempting to update my controller to allow for Foundation 6 compilation, it started throwing errors. The errors were occurring every time the compiler attempted to parse a sass map (associative array).
I started doing some research into the problem and found out that sass maps are a relatively new mechanic in sass and the last time Nsass was updated was three years ago, so I am assuming this is the problem.
Has anyone had similar experience? If so, what was your solution. If not, does anyone use anything else that would work for me? I have tried installing a couple other packages, but started receiving various other errors such as libsassnet not being able to find the 32 bit dll. Hopefully someone here can give me an answer that saves me some time.
The errors I have received when using Nsass were all along the lines of "error reading values after primary" where primary is the first value in the first map the compiler comes across. When I take that map out, it just moves to the next one and gives the same error.
As far as narrowing my question down... I just want to know what other people are using out there to compile Sass in C#
There is a nuget package: Bundle Transformer: Sass and SCSS is a provider for Bundle Transformer. In turn, this is an extension of System.Web.Optimisation that could allow you to add code to your CMS to compile user generated SCSS into Css files.
An example of this can be found in the Optimus package for the Umbraco CMS. Looking through this code could give you a good basis for creating your own system. If you speak with the Author of the package (a really nice guy) he might be able to help you create your own targeted package that isn't dependent on Umbraco.
Hope that helps.
I've been fussing around with NHibernate tutorials for months (yeah...literaly) with no success. I wanted to just get a basic "hello world" level example down pat so I could work with it and massage it into a proper use case but I can never get past the deprecated code or missing library files.
I can only assume that it is me who is at fault because of NHibernate's popularity. Would someone pleeeeeeasee lead me to a self-contained example that I can just download and run? I would absolutely appreciate it.
Many thanks to everyone (with the exception of Diego) for their help. Special thanks to Michael Buen for his suggestion with using Fluent NHibernate.
There is a great example of NHibernate 3.0 in action here that I got to work: http://www.d80.co.uk/post/2011/02/20/Linq-to-NHibernate-Tutorial.aspx
Now all I need to do is learn exactly what's going on and mold it to my uses.
I'm completely new to NHibernate, following along on the screencast at www.summerofnhibernate.com, which is awesome. Towards the end of the presentation, the unit test is supposed to pass, but for me it says:
NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The ProxyFactoryFactory was not configured.
What am I doing wrong?
I asked this because it took me a lot longer to find the answer than I would have liked. If I'm leading other newbies astray, please correct me.
Apparently since the making of the screencast, NHibernate now requires you to specify the ProxyFactoryFactory, which I don't know what that is yet, and if you're searching for this, you probably don't either.
Add this to your hibernate.cfg.xml:
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
Also add these files to your lib\NHibernate folder
NHibernate.ByteCode.Castle.dll
Castle.Core.dll
Castle.Core.xml
Castle.DynamicProxy2.dll
Castle.DynamicProxy2.xml
And add a reference to NHibernate.ByteCode.Castle.dll to your DataAccessLayerTest project
I may be way off, but after a couple hours of digging, I'm able to progress to the next screencast, and I hope you are too.
I bet you use NH 2.1 while the screencast used 2.0.
In 2.1 you have to set proxyfactory.factory_class to one of NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.LinFu.ProxyFactoryFactory or NHibernate.ByteCode.Spring.ProxyFactoryFactor
This was a very helpful answer. I downloaded the latest version of NHibernate (2.1.1.GA) with the Gallio release of MBUnit (3.1.0.0), but started running into problems when it became time to run the tests. Adding the four files suggested by mlusby and the extra line into the hibernate.cfg.xml file solved my problem. This was the only working solution I found on the internet. Thanks!
A month ago I searched for some tools that will generate C# classes out for my SQL database/tables. So I don't have to write DAL classes manually and to save a lot of time.
I came across "ORM" and subsonic. I watched the webcasts on the homepage http://subsonicproject.com/ and was pretty impressed by it.
But I am still missing more documentation/knowledge to feel comfortable with subsonic to use it in our projects. Today I read about the "migration" feature somewhere - accidental.
How to get into subsonic? How to get more comfortable with it? How to know about all the features/possibilities it provides? Are there any good blogs/tutorials/whatever for subsonic?
Unfortunately, the best SubSonic "documentation" is in the form of screencasts, but they are very easy to follow.
Quite a lot about SubSonic on Rob Conery's (original creator) blog http://blog.wekeroad.com/tags/subsonic/.
Personally found the best thing is (like Matt said) to just use it, set it up in external tools in VS, get the connection string and a few other config settings sorted, and you're just about good to go. You can get the basics down in an afternoon.
The forum is quite active http://forums.subsonicproject.com/forums/, and a good place if you get stuck.
SubSonic is irritatingly short on documentation (which is one reason I abandoned it). Scott Kuhl wrote a "Getting Started with SubSonic" document (just Google his name and SubSonic) but parts of it appeared to be out of date.
Here is Scott's blog - a place to start at least.
Here is the document's home page. I was curious as to whether the document is indeed out of date and I think it is: the web page has a last updated date in 2006.
Unfortunately, I know of no other documentation and I did look for it.
Update: See the link to documentation that Rob Conery provided in his answer.
I admit it - our docs suck :(. I did try to put a site together:
http://subsonicproject.com
Hope this helps.
Just start using it.
It is very simple and pretty straight forward. There are several screencasts on how to generate your classes with sub commander, once you have that just hit . and see what you can do with them.
I put together a template project referencing SubSonic generated off the Northwind Database. A very simple project, but should easily be enough to get started on your first project. Check it out here:
http://ajondeck.net/post/2008/12/29/ASPNET-20-SubSonic-Project-Template-With-SQL-Server-2005-Northwind-DB.aspx