remoteObject Fails After Recompiling Using CF8 - apache-flex

I've been handed a Flex project that was originally built and compiled using Flex3 and CF7. My setup is Flex3 with CF8. Everything works fine when I initially pull the project over but as soon as I recompile, remote calls to the CFCs begin to fail. I used Charles Web Proxy debugger and discovered that the failure appears to begin with the flex2gateway. I double checked to make sure the flex2gateway is accessible and it's working fine on my CF8 install from both my project root and localhost. I also double checked to make sure that my project settings directed the Flex Compiler to reference my CF8 wwwroot for the services-config.xml. As far as I can tell, all of my settings are correct. So, needless to say, I'm at a complete loss. Has anyone else encountered this problem before?
Thanks,
--Anne

Actually no errors are getting thrown which is really weird. However, after some further testing and experimentation, I did find something rather interesting. I went ahead and created a new project where the bin-debug files were all output to the web root. When attempting to call a CFC with that setup, it worked fine which is kind of strange. As soon as I started to set it up in the same file structure as the project, it stopped connecting. The file structure of the project is as follows:
_flash
main
bin-debug
libs
src
com
Test
Test.cfc
index.cfm (this is the same as the html wrapper that's usually generated in bin-debug. We have it in the root so that we can pull either the release or debug versions depending on which server we're using at the time.)
Based on this, my thought is that for some reason it's not looking to the server root for com.Test.Test and is instead just looking within bin-debug. Does that make sense? What's maddening is the utter lack of errors.
--Anne

After toying with this for considerably longer than I ever should have, I've decided to use JSON for remoting instead. This is mainly because JSON makes it considerably easier to find out what's going on under the covers when debugging. Thanks for your help everyone.
--Anne

Related

Class in App_Code folder not accessible in vb.net website project

At work I have been asked to make some amendments to a vb.net website project i've not worked on before. I've cloned the code from TFS and opened it in VS2019 but there were errors when I tried to run it. I know the website runs because my colleague has been working on it, and it is also live on a server and being used by our clients.
I have fixed some errors in the web.config and added some missing references, but now i'm getting an issue with a class called Translation which is in the App_Code folder. The class is used all around the website but i'm getting the error:
Type 'Translation' is not defined.
All of the solutions i've come across say that I need to change the build action on the class to 'compile', but that isn't possible for a website because there is no build action property. The other suggestion i've seen is to add a 'using' statement but as the class has no namespace this is not an option.
I've seen lots of people asking how to do this for websites but nobody has provided an answer, so i'm hoping someone out there can finally come up with a solution which can help me and anyone else struggling with this problem.
There is often a problem with app_code. In fact two fold. First up, is IIS will compile the code in that folder and NOT Visual Studio. This can lead to problems on deployment (some (a lot) of web sites don't have the newer rosylin complier, and I find some of the great new features (such as free form strings in code) will not compile.
But expand the app code, and then right click (properties) for say the given class, or module code you have, and change/set this: (build action)
Change above "build" action to compile (if it not already).
And even before you do above, try a re-build all (that often fixes this).
So, change above - it possible that the code/module you added to app_code not been (ever) compiled, and thus not seen in your project).
So, I actually now often create my own folder called "MyCode" and often avoid the issues of app_code. However, you might be dealing with a existing applcation.
You could also try doing this:
Rename app_code and add it again:
eg:
but, I would first try setting the code module/or class in app_code to compile in the properties sheet first. And try a re-build all.
In fact, exit VS, re-load, open project. rebuild all. Do that first, just in case (since then you don't make any changes). If exit/reload don't work, then as noted, right click on the module/class in app_code and set build action to compile.
And last but not least, you could try a re-name, and add the app_code folder - since it a specials .net folder, and manually adding that folder often does not work (don't just add folder - add "asp.net" folder) - you need to let VS add it for you as per above screen cap.
After many painful hours i've finally got the code running - mostly thanks to the efforts of my colleagues and my boss. It seems the existing project wouldn't run for me so my boss created a new project and added the required websites to that. After some fiddling with the configuration he got it working.
So unfortunately I cannot provide an answer. Apologies if you've arrived here looking for one. I'm not sure this is actually an issue anyway as I never found anything about anyone else having the problem.
Thanks to Albert D. Kallal for trying to help

Errors while compiling asp.net website

Hey guys,
i have a website, i want to place the compile code on the production server, now i took the code on the local machine and trying to compile source code on local machine, but whenever i compile the code, in one of my control(ascx.cs) file i am getting error that the control does not exists in current context, i checked everything, Inherits, CodeFile, even in the code behind(.cs) file, everything is perfect, even i get the control id in the intellisense, when i remove the control and again add the same using intellisense, the errors gets removed but after i publish site, the same error comes again....
Please reply with some suggestion/solutions.
I've had this issue before when referencing another project. It would give it intellisense, but then trying to compile would cause errors and take away intellisense. Removing and re-adding it would give me intellisense back.
The problem ended up being the target framework. The project was referencing .NET 4 Client Profile, whereas the project it was referencing was just .NET 4. Apparently this difference is subtle enough to trip up visual studio in the confusing way described above.
So take a look at your project's target framework, maybe you'll get lucky.
Definitely check your Inherits or CodeFile. I've had this happen before where I had them pointing at the wrong files.

Creating project from existing IIS/ASP.NET website, building stuff

So I'm left maintaining a proprietary codebase from a third-party vendor. The vendor is still sort of around, but support is limp. The site is ASP.NET.
I have made some changes but I am having a really hard time getting IIS to compile these changes in. The bin/ directory has what I believe is a precompiled dll for the core classes. I've changed these but it doesn't recompile. I have tried deleting the dll but then the app refuses to build saying that the Global.asax can't inherit the type anymore, so I don't really know how to rebuild with changes.
I spent all day Saturday setting up a build environment and trying to get a testing thing working. I have just been importing into VS2008 as a web site from the local IIS server. I got it to rebuild the app without changes, but it ignores changes I would place in it.
So I need to make a solution out of this website and/or directory structure so that I can do actual, big, full grown-up rebuilds and make changes to this codebase. Anyone know how I can go about this?
EDIT: A bit more elaboration. I've tried creating a blank project and just Add Existing File... on the whole website directory. This hasn't worked, it stops the import about 10% in.
Keep in mind there are two (actually, three) levels of 'builds' or compiles going on here.
1) The DLLs in the /bin directory should be pre-built, by visual studio or otherwise. The content of .ASPX, ASCX, ASHX, ASAX etc fiels are not included in those.
2) The ASPX, etc files I noted above are then compiled by IIS when the first request comes in (normally; there are ways to change that behavior). That is the source of the error with Global.asax you are seeing; With the DLL(s) gone, the class that Global.asax is supposed to inherit from does not exist.
3) Then there is the just-in-time compilation, which is not relevant for this discussion.
It sounds like you may be missing the source files for the project, or perhaps the web site is not getting properly set up as a project to compile that DLL
Try these links, I suppose this is what you are looking for.
http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2010/01/20/linking-files-in-visual-studio.aspx
http://support.microsoft.com/kb/306234
Not sure this question is really valid anymore. The source we were working with was rather different than it should have been. Not sure if someone got angry in the past and moved stuff around or what, but grabbing a new copy of the source fixed most of our issues. I am able to build now with an included csproj.
This doesn't really help many others with the same issue I suppose, but if you are getting weird build behavior like this, you might want to start with basics, like making sure that your source checkout is valid.
I am new in asp.net so I am not sure it is a professional way or not.
I have the project without .snl file. I just create a empty web site and then paste the files inside the folder where I created the project.
It worked for me.
I think pasting the files and folder directly by file manager will help you.

Why does JavaScript not work on my site under an existing virtual directory?

I deployed my ASP.NET application under an existing virtual directory. The new deployment will have some features using JavaScript. The new features are not working.
If I deploy this build under a new virtual directory, the features using JavaScript are working.
I restarted the IIS Admin service. The problem continues.
What could be going wrong here?
Since javascript runs on the client, and not on the server, I doubt that IIS, per se, has anything to do with your problem.
What have you done to attempt to diagnose the problem? Have you looked at the network interaction between the browser and the server? Perhaps some script files are not being found.
Have you turned on any debugging tools (for instance, Firebug or the F12 command in IE8)? You may be getting errors you don't know about.
Sounds like it could be a caching issue on the browser.
Is the code that calls the Javascript routines being generated dynamically? If so, it might be a path assumption. Your description was a big vague. For instance, in ASP.NET, you should use "~" to represent the applications current path. This might change. If you have code that just referrs to "/" or another (perhaps the second attempted path), then perhaps it's just a bad assumption?
Please provide more specifics. There are a hundred possible scenarios that fit your description.
Check the IIS APPLICATION POOL on IIS Manager and the project Target Framework on Visual Studio
try to match it
After the deployment if javascript features are not working then it may be beacuse executes the script which already cached. In this case to handle the situation please do the following
Try changing the JavaScript file's src?
From this:
To this:
This method should force your browser to load a new copy of the JS file.

Asp.net website first start is very slow

The first time I load the website in the production web server, it start very slow, subsequent pages load very quickly (included the home page).
I precompiled the site, but nothing changes.
I don't have any code at Application start.
I don't have cached items.
Any ideas? How can I find out what is happening?
It's just your app domain loading up and loading any binaries into memory. Also, it's initializing static variables, so if you have a static variable that loads up a lot of data from the db, it might take a bit.
When you published the site, did you choose to make the website "updatable" in the publish website's settings or not? If I remember well, the aspx / ascx file need to be compiled as well, and if they are "updatable" then the first start will cause a recompile of those resources.
Have you turned on tracing in your web.config?
Try clearing your event log?
use http://www.iis.net/expand/ApplicationWarmUp for warming up your app
this is for IIS 7.5 - so if you are running on Server R2 then it will work.
Make sure you publish your application in 'release' and not 'debug'. I've noticed this decreases loading time considerably. The web.config file will be updated.
This sounds very much like background compiling; though if you're precompiling, that shouldn't be an issue.
First thing I would look at is your ORM (if any). NHibernate, in particular, has a serious startup penalty, as it runs multiple compilers in the background at startup to turn each class in your data layer into its own in-memory assembly.
Just a quick nod at Darren. That's typical behavior of a .NET app after a DLL update is made. After the initial load everything should zip along just fine.
When you say "precompile" the site, are you using the aspnet_compiler utility to precompile, or simply using the "Build site" option in Visual Studio?
If you are not carrying out the former, I recommend giving it a spin. Coupled with Web Deployment Projects, you should have an easier time deploying your site for each release.
The initial slowness is a couple things:
The appDomain is being setup
ASP.NET is parsing and compiling the ASPX pages.
Global Contexts are being initialized.
This is normal behavior for ASP.NET.
#Mickey: No, it is turned off. Do I need to turn it on to find out?
The trace log will show you how long each action takes. It could help you find what is taking so long.
Here is a link that might help you get it setup.

Resources