Crystal Reports in ASP.NET 2.0 app - report changes not showing - asp.net

I'm developing an ASP.NET 2.0 application that includes Crystal Reports (version 10, included with VS 2005). Originally, the reports were working properly, both when run from my machine using the ASP.NET development web server, and also when deployed to an IIS server.
I made some changes to the reports and re-deployed the app to the IIS server, but the report changes are not showing up when I run the application (although they are showing up when serving the app locally on my machine). Is it possible the IIS server is caching older copies of the rpt files and not flushing them properly? I suggested this possibility to the guy managing the server, but he said he re-started the app pool and it didn't make a difference. Any ideas?

The report source object has a cache duration(in seconds) property. I think it is set to 60 seconds by default. You can either shorten this and then run the report again or alternatively you can turn it off by another property "enableCacheing". I have had mixed results with turning cacheing off so I usually just use the aspx page to set the property on the report source and lower it to 1 second to refresh the report, and then raise it back up once the cache has cleared.

Double check that the new one didn't get renamed somewhere in the process and the code is still referring to the old one.
What happens if you temporarily remove the RPT file on the web server? If you don't get an error, it's loading the report from someplace else.
Are there subreports involved?

Related

ASP.NET Website - When does session get reset

For an ASP.NET Website where i am making updates. What would cause user sessions to reset?
From my understanding if i make any changes to files in the app_code folder or the global.asax file it will reset everyone's session but if i made a change to .cs file (in the top directory) it wont reset everyone's session?
Would it reset the session of anyone that was on that page that i updated?
Can someone help me with my understanding, thank you.
Assuming memory-based session (as opposed to sql server based).
Well, the app pool restart will blow out session.
(so, in some cases even un-handled errors will blow out session).
Modify web config?
that will case app pool to restart (and blow out session).
Update any folder outside of app_data. Again, app pool re-start (and blows out session).
change content of bin folder - again app pool re-starts, (and blows out session).
Update code behind (.cs, or vb pages (code behind)). - again, app pool re-starts, (and blows out session). (so anything that will cause a re-compile of code).
There are probably a good many more - the above is a basic list.
You can thus consider adopting sql session based, and that will thus be far more robust, and I even re-started IIS services, and users if not doing anything just looking at their web page while logged on? They were able to continue working even after a full re-start of IIS services.
On the other hand, I now always use a asp.net web site "applcation". Thus no souce code is placed on the web server, and my compile is done with visual studio before deploying. The only big issue is that if you change to a application deployment model, the even just changing one line of code behind will force/require a full re-publish of the web site.
It looks like you are using a web site, and thus source code (code behind) is placed on the web server. Thus, IIS has the job of re-compiling such code, and thus any code change will as a general rule cause a app_pool re-start, and thus loss of session.
As noted, if you change from in-memory session to SQL server based (turn that feature on), then most if not all of your session issues will go away. Even if you not using "application deployment" and have/use code behind on the site for IIS to re-compile? Then using sql server-based session management should fix all of your session() woes.

appsettings.json not read in .Net Core 3.1 in basic Blazor template

I have basically installed the default Blazor WebAssembley template, with .Net Core server.
Ran the app, worked fine, comes with the initial migration for identity which ran and created the database tables so I could create an account login etc.
Changed 1 view file razor file and now the app will not run. In debug mode I can see the it seems to be empty, so the application falls over when it tries to connect to the DB with an empty connection string.
I just ran through the exact same steps on another machine and the same result, yet the only files changed are the appsettings.json and a razor file.
appsettings worked fine, then without changes no longer works. Any suggestions on where to investigate would be appreciated - this is my first step into .Net Core.
So just in case anyone else comes across this problem. I had the application open in another browser window, although I was not interacting with it.
Once I closed all the browser windows and ran the application again I no longer had the issue.
One thing to note, I am running IIS Express with the option "Do not start browser" so that VS does not keep closing and opening a new browser window.

Changes to razor view not showing

I have made some changes to a view in my ASP.NET MVC3 application, but the changes I have made are not showing up when I test/debug the site within the browser. The changes I am making are simple text amendments to the markup.
I am using the Visual Studio development server for testing the application.
The odd thing is, I have tried publishing these changes to IIS and the changes I have made to the view are working when I test the application using the IIS server.
It is only when testing in the Visual Studio environment that this seems to happen.
Thanks,
A common problem i've run into is when you are not using IE and you close the debug session, but not your browser.
This means that the "IIS/development server" is still running in your system tray, but it is running on the old compiled code, if you hit ctrl + shift + b, you build your entire solution and re-publish your code to your development server. this allows you to hit refresh (F5) in your browser and the changes you've made to the razor view should now be reflected in your browser.
Are you using IE? Maybe deleting the cache or using another browser should work? I've had a lot of problems with that :D
Solution is to use IIS Express. For some reason, the VS development server doesn't recognise changes to code behind - nothing to do with caching on the browser.
However the location of the source code as suggested in other answers is important - it works for me using the c:\windows folder or c:\users\DefaultAppPool - apparently it has something to do with security to ensure.
Only applications running under the 'DefaultAppPool' identity are permitted under IIS. So, for anyone using a VM and mapping the host OS code folder you won't be able to rectify this unless you copy to a local folder in the c:\users\DefaultAppPool folder.
You may also now have difficulties accessing the SQL server database established for the Membership Provider under ASP.NET. For more details on how to fix that, I've posted on my blog.

This application is currently offline

I was working(learning) with Data bound controls in ASP.Net and suddenly got the error:
This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.
I started searching it on google but ended up with no helpful solution. I was not able find app_offline.htm file also. And then I suddenly tried to open my project in browser again and it opened successfully and now its working. And now I have observed that in between as I am working on the project it shows this error in between (cant say when and on what criteria) and then after some time it starts working again. Can anybody help me why its happening?
I am using ASP.Net4.0 and Sql Server Express Edition.
EDIT
With somemore searching on google it seems that this gets created automatically in the solution. If we delete it the program works fine and even if you do not delete it gets deleted after sometime by itself. but will be created again after some time.
Its hard to post any code because there is no code that is giving error. But when I press (ctrl+F5) to open my project its giving error. Still for reference I created a webform Review.aspx based on a masterpage. I created a combobox and a gridview inside it. Here Combobox has some collection of numbers (GenreId) and when you select a GenreId it do Autopostback and Gridview shows the entry associated with the selected GenreId.
And then I tried to debug it in a browser, its giving error (for some time).
Here is the reason. have you try after closing all the design windows?
SQL Server 2005 express edition does not support multiple processes.
Only single process can access database at a time. So when a database
is accessed through visual studio, ASP.net runtime cannot access the
database. This will result into the internal server error. To prevent
this, VS 2005 places app_offline.htm file in the application's root
directory. The file contain above message. This causes ASP.net to put
the application in offline mode. Please note the accessing database
means opening any component of the database (I.e. table, view, stored
procedure etc.) into the design window. When design window is closed,
VS 2005 removes app_offline.htm file making the application in onliner
mode again.
http://www.codeproject.com/KB/aspnet/app_offline.aspx
Sometimes the ASP.Net DLLs aren't properly flushed from the cache, which can cause issues between builds. I would close visual studio (and make sure the web server the app is running on is stopped) and then delete any ASP.Net temporary files that are typically located in the C:\WINDOWS\Microsoft.NET\Framework[Version Number] for your application to help resolve the issue.
the app_offline.htm filename was introduced in ASP.NET 2.0 to make it much easier to show to visitors that the site's currently offline so that administrators could more easily upgrade the system or place a new version into production of the site. After removing that particular file the upgraded site's back available for people to see.
For more information take a look here: http://weblogs.asp.net/scottgu/archive/2006/04/09/App_5F00_Offline.htm-and-working-around-the-_2200_IE-Friendly-Errors_2200_-feature.aspx.
there is a file app_offline.htm on the root of your project.Remove it and build if you don't wanna see again
If you can not find the App_offline.htm file,
Go to the App_Data folder and there you will find the app_offline.htm file.
Right-click on the file and select Delete.
Good luck!

weird slowness in asp.net web app - VS 2008

I compiled my app in release mode. I then went ahead and 'published' the site.
Copies all files and moved them to a staging server with a static ip. Restarted IIS.
Went to another machine and hit my web site. It took about 4 seconds for just the default page, which is pure HTML with no custom framework usage, to show up. What gives???
Sounds like it is just the application pool spinning up. Assuming that you are the first person to hit it after deployment, this isn't uncommon. It appears fine after the first page hit, correct?
If you set the #Page directive variable "Trace=True" does that show you any load times which out out of place? Also, if you are connected to a database, running SQL Profiler for example will show you any database queries which are too slow.
Lastly, I had a strange issue where I had a virtual directory setup which pointed to a directory that didn't exist. The network timeout that ocurred looking it up took a while.

Resources