How to get asp.net website product name and version? - asp.net

Hopefully this is an easy one - though I don't seem to have much luck Googling the following:
Usually in an ASP.NET Web Application I would write - My.Application.Info.ProductName or My.Application.Info.Version, but I'm looking at an older ASP.NET Web Site and it doesn't have the Application option.
Does anyone know the equivalents?

I asked a similar question:
How should I version an ASP.NET Web Site project?
My solution was to use the assembly version of an assembly I included with my web site.

Do you mean the name as stated in the AssemblyInfo-file? In that case you can get the name by
System.Reflection.Assembly.GetExecutingAssembly().GetName()

Related

Visual Studio 2010: convert website project to web application project?

I have an existing solution in VS2010. When I click the properties of my project I get the view as can be seen in image1.png:
When I create a new empty ASP.NET web application and click the properties of my project I get the view as can be seen in image2.png:
A huge difference.
Now I'm implementing this code here: http://wcf.codeplex.com/wikipage?title=Getting%20started:%20Building%20a%20simple%20web%20api
And that tutorial assumes I get a view as I've shown you in image2.png
In image1 and image2 I've also marked the menu items: "Website" and "Project"
This makes me assume that I've created a website application whereas I need something different (I'm thinking a web application project).
Not sure what to do now, I need to convert my current application to another thing, but to which type and how to do it?
I also came accoss this post: http://blogs.msdn.com/b/webdevtools/archive/2009/10/29/converting-a-web-site-project-to-a-web-application-project.aspx
But before I start screwing up everything :P Is that what would solve my problem?
It should be possible to use either a web site or a web application project. In the example on the link you've posted, they use the predefined template for ASP.Net MVC Web Applications. This has several advantages - it sets up the structure and other resources for you - it's effectively a template.
For the purposes of the tutorial, why don't you just set up an application that way? If you've already written some code, you can just import it into the new application.
For future projects, you might want to consider which is best for your needs. Apart from structure, there are some other key differences between a web application and a web site project.
MSDN handily provides the differences here:
http://msdn.microsoft.com/en-us/library/dd547590.aspx
If you find you want the features of the web application, then the link you've posted is fine. You'll need to do some re-organizing of your references and so on and so forth, but the process is fairly straightforward (but not painless).
A "web site" in visual studio is the old, .net 1 style of creating web sites. It basically dynamically compiles the code in a folder when it's hit for the first time. Later .NET introduced a "web application" model where the code is compiled into a DLL and no code files are deployed with the site. "Web sites" are pretty much depcrated and shouldn't be used for any new projects unless you're doing a quick demo site.
The codeplex project you referenced also depends on MVC 3 (which are web applications).
You are probably better off just restarting like the tutorial says - create a new MVC application like it shows in its first screenshot.
If you do not have that option, use Web Platform Installer to add MVC for you - http://www.microsoft.com/web/downloads/platform.aspx
Good luck!
I can't tell exactly what's going on from your screenshots, but if you have a web site that you need to convert to a web application project, you can find the directions here
Although the instructions are specific to VS2005, they are basically the same for 2010 as well.

db4o on shared hosting with asp.net MVC

I'm wanting to use DB4o on an asp.net MVC project i'm working on but wondering if anyone
has got this working on shared hosting plan, have contacted discountasp and asked them and they said go to the forum
as they were not sure if they supported it or not or any configuration that would be needed.
but the forum wont let my post on because its all filtered to only show comments they like the look of?
anyone had any joy with this with another host and one that runs asp.net MVC as it should be run?
much appreciated
ta
I'm not familiar with the framework, but it seems that you can just place the DLL in the bin folder and you should be set. I've done tons of projects with MVC and the same method of placing the DLL in the bin folder and worked without issues. The host I use is ReliableSite...they're cheap and don't charge $10/mo for a SQL Server database like DiscountASP does.

Detecting Changes in an ASP.NET Web Site

The ASP.NET framework does a very good job of detecting when a file has changed and recompiling that file etc. I would like to be able to hook into that update process. Is this at all possible?
I might want to do this as part of an initiative to try and version web sites developed as Web Site projects, versus Web Applications, where the version is easily found in statically deployed assemblies. If I my be misdirecting my energies as there are already better way if versioning web sites, I'd still appreciate some pointers.
I don't know if you can hook into that logic at all - perhaps you could add your code to Application_OnStart as this method will fire when ASP.NET recycles the AppPool and restarts the website.
Have you tried Web Deployment projects?
Scott Gu has a blog post.
You can use ASP.NET SignalR to do it, It's real-time web for .NET
Have you tried developing a separate module for ASP.NET that keeps track of last change?
This might put you on the right path (might -- I haven't tried this).
http://www.codersource.net/csharp_iis_metabase.html (dead link)

Forum for ASP.NET MVC site

I am buidling a new site for an organisation. I am using ASP.NET MVC. The previous site was PHP based and had a PHPBB forum. This forum opened in an IFrame, so no integration.
We want a site with all functionality integrated. I thought, I probably have to write a forum myself. However there are other ASP.NET open source forums out there just like phpbb.
Is there a way to integrate third-party forums cleanly into my site? Or am I better of coding it myself?
Check my answer to this question, for an ASP .NET MVC based forum:
Who knows a good free open source forum in C#?
If you want an ASP .NET Webforms forum I can recommend you YetAnotherForum.NET.
ASP.NET MVC is still in beta stage and not much free options are available on the .NET side of things.
It's actually a very easy task if you already have experience writing MVC app.
Not counting those that haven't got some stable releases out, most free options such as YAF are written to run as a standalone applications on classic ASP.NET webforms framework and will often requires that you use a certain fixed database platform and thus will require work to patch them so they integrate nicely with the MVC framework.
So I suggest you code it up yourself. Especially if you just want an integrated forum that don't need to have as much features as phpbb.
Or better yet, start an open source project!
The following post has numerous options: ASP.NET MVC Forum Software?

OpenID authentication in ASP.NET?

I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?
See Scott Hanselman's post on using DotNetOpenID in ASP.NET. Andrew Arnott's blog is full of samples on using DotNetOpenID with ASP.NET, including ASP.NET MVC.
I recently hooked up DotNetOpenID for the Subtext 2.0 release. It went really smoothly - the code samples included with the DotNetOpenID download are pretty helpful. The one thing I'd recommend is that you just use the library and avoid the ASP.NET control. It uses table based layout (hardcoded) and is pretty difficult to restyle.
DotNetOpenId available at http://code.google.com/p/dotnetopenid
Are there any good tutorials on how to integrate OpenId with an ASP.NET site?
Andrew Arnott's post titled "How to add OpenID to your ASP.NET web site (in C# or VB.NET)"
I'm considering the same thing. On the Open ID site, there's a link 'For Developers' # http://openid.net/developers/ and from there is a link to 'Open Libraries' # http://wiki.openid.net/Libraries and finally from there is one called 'DotNetOpenID' # http://dotnetopenid.googlecode.com/ which is probably what you're looking for.
Good luck.
DotNetNuke may not be a good current example. When we did the integration, DotNetOpenID was not currently supporting OpenID 2.0 spec. I hacked together a fork to get the 2.0 support and have not had a chance to rip it back out for the official DotNetOpenID 2.0 release.
You should check out the DotNetNuke codebase as well, they have been using OpenID for the last several revisions, and you'll find working code for implementing it there.

Resources