Not able to get MongoDB.driver nuget for Webapi project - mongodb

I am new to MongoDB and is trying to get this new Database connected with my Web api application ..But i am not able to add MongoDB.driver nuget for my Webapi project.Please refer screen shot.
My search is struck on this window for like forever.,have even restarted my project for a couple of times now.
I also tried installing this package through
PM>Install-Package MongoDB.Driver
But then this is shown
Am I doing something wrong ..?

i tried opening this url"api.nuget.org/v3/index.json"...but it says this site cant be reached..what does that mean?
Since the you could not open the url in browser directly, there should be some internet limitations in your internet environment. If you are work in the company, I suggest you contact your office IT to confirm whether they add any limitations and whether used any proxy. If they are using some proxy, you need to set the proxy settings in NuGet.Config file which store in C:\Users\user name\AppData\Roaming\NuGet as below settings. Detailed information please refer to the Proxy settings part in Nuget Config Section & Nuget Proxy Settings.
<add key="http_proxy" value="host" />
<add key="http_proxy.user" value="username" />
<add key="http_proxy.password" value="encrypted_password" />
Besides, you can chech the proxy in your machine: Open "System Properties" > Advanced > Environment Variables. Find the http_proxy var (in System variables), select and delete it.

Related

Hosting private nuget server issue

I have setup my own nuget feed and have hosted that on our dev server.
When I try to push my packages from my local machine to dev machine as below:
dotnet nuget push C:\MyProjects\Common.2.0.0.nupkg -k myapi -s https://mydev.com/AENuget/
I get the error as:
Response status code does not indicate success: 405 (Method Not Allowed).
Now I have read and tried many settings like adding
<remove name="WebDAV" /> <remove name="WebDAVModule" />
Giving permissions to my nuget packages folder, adding app pool account but still I am not able to resolve this issue.
Secondly instead of pushing if I just copy my nuget package file to the package folder being hosted in our dev server and then in visual studio I add the new server source I get the below error:
[Package Source] The V2 feed at 'http://mydev.com/AENuget/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework=''&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
So looks like neither the push from nuget nor the copy is working. Looks like some permission issue which I am not able to resolve.
Would appreciate if someone can provide any inputs to this.
FYI: This works fine if I host this on my local machine.
The problems you are having seem to indicate you are having issues with the NuGet.Server and the system itself. These can be problems with the firewall, hosting configuration (IIS), or a wide variety of problems.
If you are on a very small team, you might just create a shared folder on a network server (with read/write access for the team). You can add the package source to Visual Studio by following this article. The source will be the UNC path to the directory (e.g. \\servername\path\to\nuget\folder).
NuGet.Server is a package provided by Microsoft and NuGet. This is used widely so I do not believe you have a problem with the package. If you encounter a specific problem, we may be able to help.

Nuget push Cannot prompt for input in non-interactive mode

I am running this command
nuget push Package.1.0.0.0.nupkg -s http://mysource.com/ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -ConfigFile ..\..\.nuget\nuget.config
I receive this error
UserName: Cannot prompt for input in non-interactive mode.
I have specified the nuget.config file which has the username and cleartextpassword like this
<packageSources>
<add key="NuGet official package source" value="http://www.nuget.org/api/v2" />
<add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" />
<add key="PackageName" value="http://mysource.com/nuget" />
</packageSources>
....
<packageSourceCredentials>
<PackageName>
<add key="Username" value="<username>" />
<add key="ClearTextPassword" value="<clearpassword>" />
</PackageName>
</packageSourceCredentials>
Why doesn't this work? I am running the batch file from within VS2013 the nuget version I am using is, NuGet Version: 2.8.50926.602
The only way I could make this work right now was based on this post from Robin Osborne.
I took the source URL (http://mysource.com/nuget) and visited it directly using iexplore
Windows asked me for authentication credentials, I entered them manually and asked Windows to save the password (this will store them in the user's Window Credentials store).
I then rerun the PS1 script that did the nuget push operation and it didn't complain at all.
Of course, this is not how it's intended to work, but at least it unblocked me from the same situation you were experiencing. Treat it as a workaround.
Don't know if this will help but. I had the same error when trying to push to our private Klondike server. We fixed this by using a valid ApiKey rather than modifying the config.
This is not for using the nuget.config file but I had the same problem just running the command line PUSH...
Go to your VSTS website and click the Package link. If you have a feed, click the Connect to feed link. If not, the same link/button will be present on the screen. Click Generate NuGet credentials. Copy the command and paste it into VS PM Console window. Then follow instruction #3 on the page and it works inside VS.
Another possible fix ( which worked in my case ) is that the Personal Access Token ( PAS ) of your Visual Studio Team Services account that you use to authenticate has expired. The default is 90 days, but you can also choose for 180 days or 1 year.
In case you don't know where you do this:
Log in to your visual studio team services
Hover on your profile icon at the right top of the screen
Click on 'Security'
On the left menu click on 'Personal Access Tokens'
You can click on the description of the expired PAS to view its properties
On the detail screen change the "Expires in" value & then click 'Save' at the bottom of the screen.

Azure Cloud Deploy Keeps Recycling

I get the following error:
Recycling (Waiting for role to start... Sites are being deployed.
[2012-12-17T05:30:10Z])
Running One or more role instance is unhealthy. 1 Instance: 1
Unhealthy
i was actually trying to convert my web application to a cloud applicaton.
here is what i did:
i added a cloud project to my solutions,
i added a webrole which linked to my web app
i created an sql azure database and copied my whole structure and also the data to the db
i inserted the connection string in my webconfig and tried to run it on emulation, this worked fine
then tried to deploy it by creating a cloud service, running the builder to create the packages and uploading the packages in "staging" mode. this is where i got the errors.
i tried to create an empty cloud app and add a default webrole and load this to the cloud, this worked fine. so i figured, maybe i have something wrong in my settings of my webrole.
I checked the difference between both and i noticed that in both solutions diagnostics was enabled but the storage account was empty in my own solution, so i inserted "UseDevelopmentStorage=true" here. this didn't change anything tho. I also saw a difference in the "packages.config"
default role had:
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.7.0.0" targetFramework="net40" />
<package id="System.Web.Providers" version="1.1" targetFramework="net40" />
<package id="System.Web.Providers.Core" version="1.0" targetFramework="net40" />
<package id="WindowsAzure.Storage" version="1.7.0.0" targetFramework="net40" />
mine had:
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.7.0.0" targetFramework="net35" />
<package id="WindowsAzure.Storage" version="1.7.0.0" targetFramework="net35" />
i tried changing in this and uploading, didn't do anything
I am not using a worker role, i have only 1 running instance (same as default)
my application uses some authentication in global.asax where it tries to read from User.Identity.Name and compare with a user in the database (this user is inserted in the sql azure db). At first I thought this would maybe be the cause of the problem, but even if i comment out this code the application will not run on the cloud.
VM size is small, trust level = Full trust
I also saw some differences in the settings where i had remote access parameters. I tried removing all these just to exclude issues
i read something about settings references to "copy local is true", but im not sure if this will do any difference.
Any ideas because I don't really know what to do anymore
EDIT:
I modified all the references to "copy local is true" and i disabled to diagnostics just to be sure there's nothing wrong with it.
but now i get the error:
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Funny thing is, in my webconfig this is already set... And I can only find 1 webconfig.
I'm not quite sure what I'm doing wrong
"Keep recycling" almost always means that there are some exception occurred when your application was started. You might not be able to see any errors or exceptions in through the Diagnostics Montor since your exception might be occurred before you configured and started the diagnostics.
I recommend you enable the IntelliTrace option when deployment. It's very easy to do if you are using Visual Studio. Then you can retrieve the IntelliTrace result through Visual Studio and figure out what exception occurred. I strongly considered there are some references missed on azure that you need to set Copy Local = true. But you need IntelliTrace to find them.
The problem was that I had some referenced projects that had an app.config file with a string to a local database

VS2012 WebDeploy Publish Breaking Web.Config

I have a MVC3 Web Application project that I develop and publish from Visual Studio 2012. This was recently a VS2010 project that was migrated.
My web.config is setup using a <location inheritInChildApplications="false"> tag so that a child application running in a virtual directory does not take on the settings.
I have setup a WebDeploy publish profile, which worked flawlessly in VS2010, but breaks my application when published from VS2012. It adds a <connectionStrings> node after the closing aforementioned </location> tag, even though I already have a <connectionStrings> node inside my <location> node. This breaks the app due to an invalid configuration file.
I've tried re-creating the profile from scratch which didn't solve the problem.
Based on what I have read here, http://msdn.microsoft.com/en-us/library/dd465337.aspx, unchecking the "Use this connection string at runtime" checkbox should instruct the publish process to NOT add the connection string, but it does anyway.
I'm thinking that this would not be an issue if I wasn't using the <location inheritInChildApplications="false">, because the connection string would get added to the right spot.
Also, note that if I publish to the File System instead of using WebDeploy, the published Web.Config is created correctly and does NOT have the extra connection string node added.
Are there any known workarounds for this issue?
As I suspected, this issue is related to the inheritInChildApplications attribute. It is likely a bug in the Visual Studio 2012 Web Deploy whereby the deploy process always adds the connection string to the configuration file, even if you tell it not to. In my case, it was also adding in the wrong spot, which broke my application.
To fix the issue, I simply stopped using the attribute and turned off configuration inheritance using one of the options listed here.
I can now publish without errors, but the process still adds the connection string to the deployed configuration file. Annoying but not a show stopper.

Crystal Reports images not visible in web viewer

I have some Crystal Reports (V10) in an application (.NET 1.1) I inherited that is deployed in four "identical" environments. In three of the environments, they are working fine. In the fourth, the chart graphics are not visible in the web viewer. They are visible if you export the reports.
The IT guys swear everything is exactly the same in all four environments and have kicked the problem back to me to solve. I'm not sure how I'm going to do that since I can't get to the servers to check anything for myself. But I don't see how this can NOT be an environment issue.
It seems to me that Crystal has the necessary permissions to write the file and to retrieve it to render the export versions of the report, but the ASP WP can't access the graphic file when the page is rendered.
Thanks for any suggestions you might have to help me!
RESOLUTION
From the IT guys: "We had to change the “Execute Permissions” on the CrystalReportsViewer10 folder within IIS from “Scripts only” to “Scripts and executables”. All of the other sites have only “Scripts Only” and they’re fine."
I could resolve this issue in dev enviroment adding next keys (handlers) to web.config:
<system.webServer>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
</handlers>
</system.webServer>
<system.web>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
</system.web>
There needs to be an IIS virtual directory called something like "CrystalReportViewers115". I think that the exact name changes between versions. This needs to be visible to your ASP.NET user. Start looking at the environments that work and see if they have this virtual directory installed, and compare it to the one on the failing environment. As another check, you should be able to enter in the URL for the images into a browser and see them. To find out the URL, right click on the picture and select "Properties". For example:
http://localhost/crystalreportviewers/images/toolbar/export.gif
You should see the picture when you browse directly to the URL.
Go to Start->Programs->Microsoft Visualstudio 2008->Visual Studio Tools->Visual Studio 2008 Command Prompt
and type
aspnet_regiis -c
This will automatically copied the corresponding files...
Add the aspnet_client folder in the source folder of the site. Example:
C:\inetpub\wwwroot\myapplication\aspnet_client\system_web\4_0_30319\CrystalReportWebFormViewer4
I recently experienced this very issue: although my resolution was a little different:
I tried setting the handler in the web.config but that didn't fix it.
I tried setting scripts & executables in IIS but that didn't fix it.
Once I went into the C:\Program Files\Common Files\Crystal Decisions\2.5\crystalreportviewers10 folder and turned off custom errors I could see the error was coming from an access denied issue on C:\Windows\Temp\
The solution was then to not and handlers or alter IIS to run scripts and executables, it was to allow the Network Service to read permission on C:\Windows\Temp\
EDIT:
Think I've found another solution which doesn't require permission changes... just set a virtual directory for aspnet_client; the level at which you select this will very much depend on your IIS layout.