invalid resx file. Could not find file ..\..\My Project\Resources.resx - asp.net

I was working with a web project in the .NET 2.0 Framework, but when i open the project in the 4.0 Framework it gives me invalid resx file error. The way my project works is that i have an empty solution, then i add a project, then a website. So it is a solution with two projects in it, one with the VB script, the other with the aspx pages

If you use IIS you might have forgotten to edit the framework in the settings.
if you moved it its just the filepath that is invalid. try to use Utility.RawApplicationPath and then you just go from there.
Utility.RawApplicationPath"/myResourceFolder/myResources.resx"
I use my resources like that and I never had any problems ;)
Hope this helped you.

Related

ASP.NET Empty Web Applcation for F#

Does anyone know if there are web templates for F#? Specifically, the ASP.NET Empty Web Application. I am looking for VS2012.
Actually, this is not exactly what I need to create a F# Web Applcation - I don't want any C# at all. I went and added this line to the .fsproj file like this:
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21}</ProjectTypeGuids>
But I get this when I try and load the project:
error : Specified method is not supported.
I guess FSharp can't be used for a web application? How lame is that?
Never mind - found it on the Online Templates under Visual F#.
Thanks

Reference aspx pages from different web project

I have an ASP .NET web form solution with multiple web projects. There is one core web project and each of the other web project work as pluggable modules.
I have written a post build event to copy aspx/ascx files and *.dll of child web projects to the core web project directory.
The issue is - I am not able to call child project aspx pages from the core project. I get "Could not load type" error.
Is it possible to use aspx pages in different project if i refer that webproject dll and copy the aspx files to the main application? What am i doing wrong here. I would greatly appreciate any pointer in the right direction. Thank you.
Sanjay
I found answer to this. The key is to define you assemblies in the web.config file and then define a probing path. Following is the link with details-
http://weblogs.asp.net/chrismoseley/archive/2008/10/28/shared-assemblies-without-the-gac.aspx

import a "published" website into visual studio as a solution

We have a website which is already deployed in the production server. We need to remodify the application and then re-deploy it. But we do not have access to the code-behind files as everything is compiled into a dll.
Your options are basically
1) Modify aspx / ascx files to alter text content / styling, though you won't be able to add any functionality here (well not server-side functionality anyway).
2) Reverse-engineer the DLL to produce the code-behind classes which will only produce readable code providing the assembly wasn't obfuscated. You could look at Redgate Reflector for doing this. (It's a useful developer too to have anyway).
As far as getting the files into a solution is concerned you could try creating a new web application project (deleting the Default.aspx and it's web.config which are generated as standard) then adding the aspx/ascx files into this project.

can you easily mix in one project C# and VB.aspx

you should be able to merge the assemblies... but just wondering if you had a VB.net web app, and then had a C# project, how would you merge the aspx pages?
can it be done?
For Web Site projects, you can place your C# source code files in App_Code\CS and your VB.NET files in App_Code\VB. Your ASPX files can be either language, as stated in the #Page directive.
For Web Application projects, you are limited to one language per project. You can deploy as many projects of different languages as needed.
You can easily mix VB and CS projects in the same solution. Suposedly (see link below) you are able to mix them within the same project. I have never tried the method specified below though so I can't tell you if it actually works. There is no IDE support for it though:
Mixing C# and VB.NET in one assembly
You might be able to take two projects, built independently into aspx files and a dll, and deploy the aspx files and the two dlls to the bin directory. It might work,but I don't know how well something like Global.asax will handle that, since those methods would be in both dlls.
If they're both deployed to the same folder in IIS, there is nothing stopping you from having some .aspx files in C# and some in VB.NET. Obviously, in one Visual Studio project, you can only have all-VB.NEt or all C#, but you can still deploy two projects to the same web application.
I would question the value of this in general, though, since it means your developers will need to be familiar with both languages. We have done this in the past, though, when writing DotNetNuke modules - DotNetNuke itself is written in VB.NET (for some bizarre reason), and we developed our custom modules in C#.

Why is global.asax missing from a Website Project

A couple of questions regarding the role of global.asax:
Why is it not included in the Website Project in Visual Studio? Are there other ways of achieving the same functionality without this file?
If I would create a Web Application project, as far as I remember, a global.asax file would be created. If I were to delete it, would the project run?
I tried to look for some explanation regarding the global.asax compilation but didn't find any info about this.. would appreciate help/links. :)
Thanks!
An ASP.NET site can run without the global.asax file. Here is a question which talks about alternatives of global.asax file.
Even if you delete a global.asax file your site will work.
Globax.asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).
You can add Global.asax to the website project and it will work fine.
Global.asax is not added by default for web applications. If you have it, you can delete it without problems.
Be careful to include the .compiled files when deploying the website or else the events in Global.asax will not fire.
It sounds like you are familiar with Web Application Projects, now see a Web Site "project" and wonder what's going on. In any case, I'll answer as though that were true. ;-)
In Visual Studio 2005, Microsoft introduced Web Site "projects", which are not projects - they're just directory structures on a local disk, FTP site, etc. They do many things differently from Web Application Projects, and can therefore be confusing (especially if you're like me, trying to answer people's questions, not knowing which they are using).
With Visual Studio 2005 SP1, they restored Web Application Projects. If that's what you're more familiar with, then I suggest you use them. They're real projects, just like they always were.
And, BTW, there will be a global.asax, just like there used to be...

Resources