I'm playing with an embedded RavenDB => RavenDB-Embedded.1.0.499 package installed via NuGet in Visual Studio 2010. It's being used in a current project that I started after reading this excellent MSDN article:
Embedding RavenDB into an ASP.NET MVC 3 Application
Now I'd like to access the RavenDB Management Studio (Web UI).
I followed the steps described here: Is it possible to connect to an embedded DB with Raven Management Studio and here Running RavenDB in embedded mode with HTTP enabled but I didn't get the point.
This is the code I'm using to initialize the DocumentStore:
_documentStore = new EmbeddableDocumentStore
{
ConnectionStringName = "RavenDB",
UseEmbeddedHttpServer = true
};
and this is the ConnectionString present in Web.config:
<add name="RavenDB" connectionString="DataDir = ~\App_Data\Database" />
I also read the steps described in RavenDB: Embedded Mode. I tried to start the server manually:
// Start the HTTP server manually
var server = new RavenDbHttpServer(documentStore.Configuration,
documentStore.DocumentDatabase);
server.Start();
but the above code seems outdated since I have no RavenDbHttpServer, documentStore.Configuration and documentStore.DocumentDatabase. I managed to find Raven.Database.Server.HttpServer but the other objects are missing in the _documentStore.
So, the question is:
How can I hit the Web UI to visualize my embedded database docs? What's the URL I should put in my browser address bar?
Any advice is appreciated.
EDIT: I've found a way of getting it to work. As I described in my blog post it may not be the best approach but it does work:
RavenDB Embedded with Management Studio UI
Note: one downside of the above approach is that I'm not able to access the database in my app because once it has been opened by the server it gets locked. This way I have to stop the server and then reload my app in the browser.
I hope RavenDB's gurus out there have a better/correct approach... just let us know.
I've never had to run the server manually in order to access the management studio. The only few steps that haven't been mentioned in your question that I usually do:
// Add the following line prior to calling documentStore.Initialize()
Raven.Database.Server.NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);
Copy Raven.Studio.xap into the root folder of my web project.
When my web application is running, the RavenDB Management Studio is then accessible at http://localhost:8080.
Related
I'm upgrading a project from an older version of DevExpress to the latest version of DevExtreme and having an issue with the pivot grid's OLAP connection. In the old version, we could bind to a connection string as follows:
#Html.DevExpress().PivotGrid(pivotSettings).BindToOLAP("provider=MSOLAP;data source=.;initial catalog=Dashboard AS;cube name=Dashboard Cube").GetHtml()
In the new one, there is no option for a connection string and I am forced to provide a URL for msmdpump.dll.
I followed some of instructions here: Configure HTTP Access to Analysis Services on IIS 8.0
However, that is for IIS and not IIS Express, so I basically just copied the files to /wwwroot/OLAP/ in my new .NET Core application.
My pivot grid has the following definition:
#(Html.DevExtreme().PivotGrid()
.ID("pivotGrid")
.Width("100%")
.AllowSortingBySummary(true)
.AllowFiltering(true)
.ShowBorders(true)
.ShowColumnGrandTotals(true)
.ShowRowGrandTotals(true)
.ShowRowTotals(true)
.ShowColumnTotals(true)
.FieldChooser(c => c.Enabled(true))
.DataSource(d => d.RetrieveFields(true)
.Store(s => s.Xmla()
.Url("/OLAP/msmdpump.dll")
.Catalog("Dashboard AS")
.Cube("Dashboard Cube")
)
)
)
and the msmdpump.ini is as follows:
<ConfigurationSettings>
<ServerName>localhost</ServerName>
<SessionTimeout>3600</SessionTimeout>
<ConnectionPoolSize>100</ConnectionPoolSize>
</ConfigurationSettings>
The problem is I keep getting a 404 in the browser console even though the URL is correct:
http://localhost:4116/OLAP/msmdpump.dll
I can't find any instructions for getting msmdpump.dll to work with IIS Express.
I'm thinking maybe IIS Express prevents the browser from accessing DLLs directly? I'm not certain... but it did give me a 404 on the .ini file as well when I tested that. If this is the problem, how do I solve it?
Any help would be greatly appreciated.
We have scaled-out some portions of our ASP.NET app to run on one server, and other portions to run on another server (& under a subdomain).
The two servers share (SQL Server) Session. We used this MS article to create a tiny HTTP Module to sync app domain name between the two servers (sans the cookie domain code, which can be configured in the web.config. I later found this CodeProject article which is essentially the same.)
Everything's working well, except for a small issue: deployment changes or web.config tweaks require a manual app pool recycle (the auto-recycle no longer works - instead we get the "web server is currently unavailable / hit refresh" error).
I tried moving the app domain naming code from the HTTP Module into the Application_Start section of the Global.asax (maybe this is a better place for it?) - but received the same problem.
I know that one solution is to hard-code the app name in one of the SQL Server Session stored procedures; but am a bit hesitant to do this.
Edit: The app is ASP.NET 3.5 under IIS 6.0 (thanks #Chris & #bzlm)
You should check if proper Recycling Events are turned on in IIS, maybe this can help http://support.microsoft.com/kb/332088
Update. We opened a tech support case with Microsoft about this. After a week or so of back & forth, they said they had reproduced the issue in their environment and understand the cause (a timing issue deep inside the ASP.NET internals) - but that there is no resolution that they're aware of. I complained that the HTTP module is Microsoft code, but they said that this code is under "FAST PUBLISH" terms - intended to help & advise customers; yet not warranted.
Ah well. We now just manually recycle the app pool after making a web.config change.
I'm using the web deploy API to deploy a web package (.zip file, created by MSDeploy.exe) to programmatically roll the package out to a server (we need to do some other things before we release the package which is why we're not doing it all in one go using MSDeploy.exe).
Here's the code I have. My question is really to clarify what is happening when this is executed. In the package parameters XML file I have the application name specified ("Default Web Site") but that's about it, there's no other params are specified in there. From testing the server it appears the package gets deployed successfully but my question is are any other settings on the server I'm deploying to getting changed without my knowledge, are any default settings published etc.? Things like security settings, directory browsing etc. that I might not be aware of? The code here seems to deploy the package but I'm anxious about using this on a production environment when I'm so unsure of how this API works. The MS documentation is not helpful (more like non-existant, actually).
DeploymentChangeSummary changes;
string packageToDeploy = "C:/MyPackageLocation.zip";
string packageParametersFile = "C:/MyPackageLocation.SetParameters.xml";
DeploymentBaseOptions destinationOptions = new DeploymentBaseOptions()
{
UserName = "MyUsername",
Password = "MyPassword",
ComputerName = "localhost"
};
using (DeploymentObject deploymentObject = DeploymentManager.CreateObject(DeploymentWellKnownProvider.Package,
packageToDeploy))
{
deploymentObject.SyncParameters.Load(packageParametersFile);
DeploymentSyncOptions syncOptions = new DeploymentSyncOptions();
syncOptions.WhatIf = false;
//Deploy the package to the server.
changes = deploymentObject.SyncTo(destinationOptions, syncOptions);
}
If anyone could clarify that this snippet should deploy a package to a web site application on a server, without changing any existing server settings (unless specified in the SetParameters.xml file) that would be really helpful. Any good resources on using the API or an explanation of how web deployment works behind the scenes would also be much appreciated!
The setparameters file just controls the value for the parameters defined in the package. A package might be doing much more than that. Web deploy has a concept of providers and any given package can have one or more providers.
If you want to make sure that the package is not changing server side settings the best approach you can take is to use the API but make the packages be deployed via Web Management Service. This will give you two benefits:
You can control what providers you allow through.
You can add users and give restricted permissions to them to deploy to their site or their folder etc.
The alternate approach is to:
In the package manually look at the archive.xml and look for the providers in the package. As long as you dont see any of the following providers that can cause server settings change such as apphostconfig or webserver or regkey (this is not a comprehensive list) you should be good. Runcommand is a provider that allows you to execute batch scripts or commands. While it is a good provider for admins themselves you need to consider whether you want to allow packages with such providers to run.
You can do the above mentioned inspection in code by calling getchildren on the deployment object you create out of the package and inspect the providers and the provider paths.
Is there a way to enable and see server output on IIS 6.0?
I have deployed my VS 2008 MVC 2 project into IIS 6.0 with wildcard mapping. Static views show up correctly, but database access doesn't work.
My problem is I don't see any error message or error output. So I wonder if I can see server output for my sample web site, that could help me to see what goes wrong?
For example, I will put output before and after connection, the easiest way to debug.
Console.WriteLine("Before connection");
Console.WriteLine("After connection");
However, IIS Manager doesn't allow me to see anything server output except log, which record only GET and POST actions.
There is no "server output". You can have your code write lines to a log file or you can use Visual Studio to attach to the process and debug it that way.
If you need to log NHibernate information to diagnose a problem, use log4net. See this article as reference.
I've got a class library doing all my NHibernate stuff. It also handles all the mapping using Fluent NHibernate - no mapping files to deploy.
This class library is consumed by a number of apps, including a Windows Service running on my computer. Although it works fine in all my web apps, the Windows Service gets this when it tries to use NHibernate:
An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
at FluentNHibernate.Cfg.FluentConfiguration.BuildSessionFactory()
at Kctc.NHibernate.KctcSessionFactory.get_SessionFactory() in C:\Kctc\Trunk\Kctc.NHibernate\KctcSessionFactory.cs:line 28
...more stack trace...
I have checked for an InnerException and there doesn't appear to be one. I have no idea what the PotentialReasons collection is, and Google doesn't seem to be forthcoming either.
This is my dev machine, so when I'm working on my web apps they run locally (i.e. using the web server in Visual Studio). The fact that the Windows Service and my dev web apps are running on this same machine suggest it's not to do with trust settings or what have you.
Can anyone suggest what I should try? This is one of those ones where I'm so stumped I can't even think of how to get more information about the problem.
Just a wild guess. NHibernate picks up the hibernate.cfg.xml file from the execution directory. Did you configure the execution directory of the service that it can find this file?
I've found out what the problem is. The Service did not deploy with the required NHibernate.ByteCode.LinFu.dll.
I appear to have an ongoing problem with the Visual Studio compiler not always copying indirect dependencies (i.e. dlls required by class libraries required by the app) into the output folder during the build. I should have thought of this sooner really.
Thanks for racking your brains on my behalf guys.
I bet the name of the connection string is missing from the app.config. For me that message is almost exclusively a missing connection string.
Are you targeting the same database or could it be some sort of schema mismatch between databases?
Could it be authentication issues on the service like you use windows authentication where it can't be used (or the sql authentication that doesn't work)?
It's hard to tell when there is no code, just an exception!
EDIT Are you ever using HttpContext, HostingEnvironment or anything else specific to "web"?