I figure out that NuGet allows proxy settings configuration since 1.4 version (June 2011). But, I can't find any command line example.
I'm trying to run some build and NuGet can't connect.
How do I configure the proxy settings on the command line?
Here's what I did to get this working with my corporate proxy that uses NTLM authentication. I downloaded NuGet.exe and then ran the following commands (which I found in the comments to this discussion on CodePlex):
nuget.exe config -set http_proxy=http://my.proxy.address:port
nuget.exe config -set http_proxy.user=mydomain\myUserName
nuget.exe config -set http_proxy.password=mySuperSecretPassword
This put the following in my NuGet.config located at %appdata%\NuGet (which maps to C:\Users\myUserName\AppData\Roaming on my Windows 7 machine):
<configuration>
<!-- stuff -->
<config>
<add key="http_proxy" value="http://my.proxy.address:port" />
<add key="http_proxy.user" value="mydomain\myUserName" />
<add key="http_proxy.password" value="base64encodedHopefullyEncryptedPassword" />
</config>
<!-- stuff -->
</configuration>
Incidentally, this also fixed my issue with NuGet only working the first time I hit the package source in Visual Studio.
Note that some people who have tried this approach have reported through the comments that they have been able to omit setting the http_proxy.password key from the command line, or delete it after-the-fact from the config file, and were still able to have NuGet function across the proxy.
If you find, however, that you must specify your password in the NuGet config file, remember that you have to update the stored password in the NuGet config from the command line when you change your network login, if your proxy credentials are also your network credentials.
Maybe you could try this to your devenv.exe.config
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://proxyaddress" />
</defaultProxy>
<settings>
<servicePointManager expect100Continue="false" />
<ipv6 enabled="true"/>
</settings>
</system.net>
I found it from the NuGet Issue tracker
There are also other valuable comments about NuGet + network issues.
Just in case you are using the HTTPS version of NuGet, be aware that you have to set the values with HTTPS.
https_proxy
https_proxy.user
https_proxy.password
I could be wrong but I thought it used IE's proxy settings.
If it sees that you need to login it opens a dialog and asks you to do so (login that is).
Please see the description of this here -> http://docs.nuget.org/docs/release-notes/nuget-1.5
Another flavor for same "proxy for nuget": alternatively you can set your nuget proxing settings to connect through fiddler. Below cmd will save proxy settings in in default nuget config file for user at %APPDATA%\NuGet\NuGet.Config
nuget config -Set HTTP_PROXY=http://127.0.0.1:8888
Whenever you need nuget to reach out the internet, just open Fiddler, asumming you have fiddler listening on default port 8888.
This configuration is not sensitive to passwork changes because fiddler will resolve any authentication with up stream proxy for you.
To anyone using VS2015: I was encountering a "407 Proxy Authentication required" error, which broke my build. After a few hours investigating, it turns out MSBuild wasn't sending credentials when trying to download Nuget as part of the 'DownloadNuGet' target. The solution was to add the following XML to C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe.config inside the <configuration> element:
<system.net>
<defaultProxy useDefaultCredentials="true">
</defaultProxy>
</system.net>
The solution for me was to include
<configuration>
<config>
<add key="http_proxy" value="http://<IP>:<Port>" />
<add key="http_proxy.user" value="<user>" />
<add key="http_proxy.password" value="<password>" />
</config>
</configuration>
In the nuget.config file.
Maybe this helps someone else. For me the solution was to open NuGet settings on Visual Studio (2015/2017) and add a new feed URL: http://www.nuget.org/api/v2/.
I didn't have to change any proxy related settings.
On Windows Server 2016 Standard, which is what I develop on, I just had to open the Credential Manager Control Panel and clear out the cached proxy settings for Visual Studio which were no longer valid and then restart Visual Studio. The next time I opened the Nuget Package Manager I was prompted for proxy credentials, which got me working again.
See: https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager
Just a small addition...
If it works for you to only supply the http_proxy setting and not username and password I'd recommend putting the proxy settings in a project local nuget.config file and commit it to source control. That way all team members get the same settings.
Create an empty .\nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
</configuration>
Then:
nuget config -Set http_proxy="http://myproxy.example.com:8080" -ConfigFile .\Nuget.Config
And finally commit your new project local Nuget.config file.
Hello for me going into
%appdata%/Roaming/Nuget/NuGet.Config and removing every line except for the package sources. Which should give something like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
Full path should be C:\Users<username>\AppData\Roaming\NuGet\NuGet.Config
Basically there was a proxy set, i don't how and why it was set but it was there and i couldn't ping it either.
Try this. Basically, connection could fail if your system doesn't trust nuget certificate.
Apart from the suggestions from #arcain I had to add the following Windows Azure Content Delivery Network url to our proxy server's the white-list:
.msecnd.net
Above Solution by #arcain Plus below steps solved me the issue
Modifying the "package sources" under Nuget package manger settings to check
the checkbox to use the nuget.org settings resolved my issue.
I did also changed to use that(nuget.org) as the first choice of package source
I did uncheck my company package sources to ensure the nuget was always picked
up from global sources.
As a late answer, for me nothing worked here. I guess this might depend on your company proxies or how the nuget is implemented but for some reason I had the following environment variables set: http_proxy and https_proxy. After I removed them, nuget started working correctly.
It's correlated, but not the same cenario here, but I would like to document for those on Linux.
I'm on Fedora 35 using VsCode and dotnet sdk 6 installed
To use dotnet add package behind proxy I have to use this format of command:
export http_proxy=http://[user]:[pass]#[server]:[port] && dotnet add package <package>
Related
I am learning how to use Visual Studio and publish/consume NuGet packages. After following these tutorials:
https://learn.microsoft.com/en-us/nuget/consume-packages/overview-and-workflow
I can create a simple NuGet package and publish/build it fine, as well as find the resulting .csproj project file.
One task I've been assigned is creating a Visual Studios Solution File that will automatically download a NuGet package, but I haven't seen this talked about in the NuGet documentation yet.
How can I to create a Solution File ( or maybe a project file?) for Visual Studio 2019, such that any user can consume (run?) this file with their project, to have NuGet project automatically downloaded to their Visual Studio project?
OP:
I can create a simple NuGet package and publish/build it fine, as well as find the resulting .csproj project file.
...and OP:
I know you can search for a NuGet package through the visual studio interface to download. But If I have a package hosted in a private artifactory repo, wondering if there are any other ways in visual studio to download it
So I am assuming you have already published the NuGet package, referenced it in your projects via Manage NuGet Packages for solution... at least once and committed the results to source control for others in your team to use. But the problem is that you would some form of automatic workflow so that when your team members open the solution, the packages are automatically restored even though they are on your private NuGet server wherever that may be, something your team members environment is not currently configured for. This is not a problem.
So there's a two ways this can be done:
Specifying additional NuGet package sources in Package Manager Settings in Visual Studio
Modifying NuGet behaviour at solution, user or machine scope
1.0 Choices
1.1 Manually configure NuGet via Package Manager settings in Visual Studio
#1, is arguably the easiest as is done via VS's user interface. Unfortunately it does require team members to manually apply these settings which is something you wanted to avoid in the first place. Additionally is is essentially user-scope so will affect any solution you open in Visual Studio leading to possible problems if multiple solutions are fighting over custom configuration:
Also be warned, if like me you are working-from-home and have added your employer's NuGet server to the above, don't be surprised that the build suddenly stops working, specifically NuGet restore. I often find myself having to re-authenticate with my employer account or temporally disabling the custom NuGet source.
1.2 Configure NuGet via NuGet.config files present in source control
In this option you configure NuGet via nuget.config files, something that can be added to source control. Why is that important? Well when your team grabs the latest code say via Git, they'll also find a brand spanking new nuget.config in the repo's root folder that Visual Studio (and CI servers for that matter) will detect, leading to an automatic solution-specific configuration of NuGet that will add your custom NuGet packages to the restore operation when you go to build your solution. Yay!.
You have complete freedom over where such customisation are applied depending upon scope:
solution
user
machine
MSDN has this to say on nuget.config files:
nuget.config is an XML file containing a top-level node, which then contains the section elements described in this topic. Each section contains zero or more items. See the examples config file. Setting names are case-insensitive, and values can use environment variables.1
...and:
NuGet's behavior is driven by the accumulated settings in one or more NuGet.Config (XML) files that can exist at project-, user-, and computer-wide levels. A global NuGetDefaults.Config file also specifically configures package sources. Settings apply to all commands issued in the CLI, the Package Manager Console, and the Package Manager UI.2
Here's an example nuget.config. Note how I list my custom NuGet package source first (though not entirely necessary) before listing the standard NuGet source. The config file does not have to exist in the same folder as the Visual Studio solution (.sln) file but perhaps in the repo root (see below) so when the solution is built, preference is given to it over any other settings (including what is in VS's user interface):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<clear />
<add key="repositoryPath" value="packages" />
</config>
<packageSources>
<!-- When <clear /> is present, previously defined sources are ignored -->
<!-- Remove this tag or un-comment the nuget.org source below to restore packages from nuget.org -->
<!-- For more info, see https://docs.nuget.org/consume/nuget-config-file -->
<clear />
<add key="Contoso" value="https://mickyd.com/packages/" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
Microsoft recommends that you place the nuget.config file (my emphasis):
...in the root of your project repository. This is considered a best practice as it promotes repeatability and ensures that different users have the same NuGet configuration.1
Be sure to check out the rather detailed Example config file on MSDN.3
1 "nuget.config reference", MSDN
2 "Common NuGet configurations", MSDN
3 "Example config file"
I am replicating web application deployment and found several issues related to HTTP Error 500.19. My machine is running Windows 7 while the working development is using Windows 8. We're developing our Web Application using Visual Studio 2010.
First, I got error code 0x80070021, similar as posted here.
I update my web.config according to the accepted answer and then I got following error code (which is similar as posted here).
HTTP Error 500.19 - Internal Server Error
Error Code 0x8007000d
Config Source -1: 0:
I have read the symptoms definition in Microsoft support page and cause of the error is:
This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.
and the solution is
Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.
However, the web.config that I used is working perfectly in the original development environment.
Here is what I have checked and tried so far:
Install ASP.NET by calling aspnet_regiis -i
Set my application to use different application pool (ASP.NET v4.0, .NET v4, etc)
ApplicationHost.config file is still using default from Windows 7.
This is part of my Web.Config
<system.webServer>
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
<handlers>
<remove name="UrlRoutingHandler" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<urlCompression doStaticCompression="true" doDynamicCompression="false"></urlCompression>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<add value="Logon.aspx" />
</files>
</defaultDocument>
</system.webServer>
I have read similar/duplicates/closed posts (around 13) posts in stackoverflow, tried all except the answer related to Ajax (is it related) and still have no clue on what the error is.
Does anyone one how to fix this error? (And if possible, a comprehensive lists of things need to be checked so we can reduce similar posts like this.) I am ready to provide more details.
Error 0x8007000d means URL rewriting module (referenced in web.config) is missing or proper version is not installed.
Just install URL rewriting module via web platform installer.
I recommend to check all dependencies from web.config and install them.
When trying to set up a .NET Core 1.0 website I got this error, and tried everything else I could find with no luck, including checking the web.config file, IIS_IUSRS permissions, IIS URL rewrite module, etc. In the end, I installed DotNetCore.1.0.0-WindowsHosting.exe from this page: https://www.microsoft.com/net/download and it started working right away.
Specific link to download: https://go.microsoft.com/fwlink/?LinkId=817246
Yes, for .net core apps, install dotnet hosting. This worked for me.
And here it is for .net6
And now if you need .net7
Install URL rewriting:
UPDATE - this is now available here (and works with IIS 7-10):
https://www.iis.net/downloads/microsoft/url-rewrite
Ensure you have the following set to 'Allowed' for your IIS server:
In my case, because I had reinstalled iis, I needed to register iis with dot net 4 using this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
In my case (.Net Core Web API) for this issue HTTP Error 500.19 – Internal Server Error 0x8007000d
First download dotnet-hosting-3.0.0-preview5-19227-01-win (.Net Core 3) or dotnetcore 2 hasting windows
https://download.visualstudio.microsoft.com/download/pr/5bed16f2-fd1a-4027-bee3-3d6a1b5844cc/dd22ca2820fadb57fd5378e1763d27cd/dotnet-hosting-3.1.4-win.exe
Any .net core 3.1 application either angular or mvc application would need this.
Second install it as Administrator
Open cmd as administrator, type iisreset, press enter
So refresh your localhost app
Best regard
M.M.Tofighi from Iran
A repair of the DotNetCore hosting bundle did the trick for me. :/
Installing ASP.NET Core Runtime Hosting Bundle solved the issue for me. Source: 500.19 Internal Server Error (0x8007000d)
Kind of late to the party here, but I have just been struggling with the exact same issue (symptoms) and cursing the lack of error detail reporting.
It worked fine on IIS 8+ machines but Win 7 got these INSTANT HTTP 500.19 errors.
For me it was as silly as having an unsupported configuration element in the config file:
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
So while running old web.config files worked fine, I just diffed them and started chopping away at new blocks until I got the page to start loading. Had I seen this as an answer I would have gone this route immediately as I knew none of the popular solutions were relevant. So there you go :)
I turn on .Net Framework 3.5 and 4.5 Advance Service in Control Panel->Programs and Features->Turn Windows features on or off.it work for me.
Problem solved. Here are the steps that I tried:
Enable the 32-bit application in IIS -> Application pool -> Advanced settings
Copy System.EnterpriseServices.dll and System.EnterpriseServices.Wrapper.dll from C:\Windows\Microsoft.NET\Framework\v2.0.50727 to the application bin folder
Do comments/uncomments to sections on the web.config and found that problem related to the referenced DLL.
The config that I commented the previous one that I added:
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow"/>
Add the required FasterFlect.DLL used by Combres.DLL v2.1.0.0 to the application bin folder (shall download the full zip from Combres codeplex, because the required fasterflect DLL V2.0.3732.24338 cannot be found in fasterflect codeplex) and other DLLs. For convinience, use the full Combres.DLL (1,3MB)
Check that the DLL versions and public key tokens are configured correctly in web.config using tool, e.g. .NET Reflector
I understand that this error can occur because of many different reasons. In my case it was because I uninstalled WSUS service from Server Roles and the whole IIS went down. After doing a bit of research I found that uninstalling WSUS removes a few dlls which are used to do http compression. Since those dlls were missing and the IIS was still looking for them I did a reset using the following command in CMD:
appcmd set config -section:system.webServer/httpCompression /-[name='xpress']
Bingo! The problem is sorted now. Dont forget to run it as an administrator. You might also need to do "iisreset" as well. Just in case.
Hope it helps others.
Cheers
For me, it was all about setting up my web server to use the latest-and-greatest tech to support my ASP.NET 5 application!
The following URL gave me all the tips I needed:
https://docs.asp.net/en/1.0.0-rc1/publishing/iis-with-msdeploy.html
Hope this helps :)
I had this problem with a brand new web service. Solved it by adding read-only access for Everyone on Properties->Security for the folder that the service was in.
I had the exact same error. It turned out that it was something was caused by something completely, though. It was missing write permissions in a cache folder. But IIS reported error 0x8007000d which is wildly confusing.
I have the same problem when I was trying to publish asp.net core 5.0 web app on my local IIS and the solution was to add the following inside System.webserver tag in my web.config file
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
Reinstalling ASP.NET Core Runtime - Windows Hosting Bundle Installer made the trick for me... I belive the "ASP.NET Core Module" was missing.
For me I had a web.config file in one my root folders, this config file was for the live server so removing it allowed the site to run on the dev server.
So check for any web.config files in folders too.
In my case, i have installed dotnet hosting but error change to HTTP Error 503. The service is unavailable, but after install windows update KB2999226 and dotnet sdk, its work!
follow the procedure chronologically or it might fail due to missing or errors in redirecting.
install Runtime bundle e.g.. dotnet-sdk-7.0....
2.turn asp services on and internet services"Turn Windows features on or off" to enable IIS
3.install web hosting bundle iis 7.0 e.g dotnet-hosting-7.0.2...
this worked for me
I am writing a Web API 2.0 project and a test project using Visual Studio 2013.
In the test project, I saved some information in the Settings.settings file (under TestProject->Properties in the Solution Explorer). One of the things saved there is the connection string to a database that is stored locally.
Unfortunately, the connection string will be slightly different on each person's computer when they download the repo. When people push their code to the master repo it overwrites the connection string, affecting everyone else.
What is the best way to make this configurable for each user such that everyone can have their own database path, but pushing to master repo won't affect anyone?
Edit
I don't think this is exactly a duplicate of that other question. Although, yes, my configuration settings are stored in app.config (since they happen to be application settings rather than user settings), following the solution in the other answer will lead me with the same problem. The app.config will contain configSource="otherconfig.config", and when people push that file to the master repo, it will still clobber other people's values. I need something that allows the custom configurations to be source-controlled without affecting the other users of the project.
Visual Studio handles this automatically for WEB projects through Web.config transformations
You'll need to install a separate plugin for use with App.config and non-web projects. http://visualstudiogallery.msdn.microsoft.com/579d3a78-3bdd-497c-bc21-aa6e6abbc859
The plugin basically adds the same functionality to app.config files, and works with the same syntax in the transform files.
Your best approach to this is to use Build Profiles. Have a developer-specific Web.developer.config and with that you get each user to choose their name in Configuration Manager. Then just make the new config, which is technically an XSLT make the changes needed for each team member.
Think of it as Debug vs Release configs, except in your case you'll have many Debug (one for each user). The Build profile you set doesn't get checked into TFS, so you're fine.
This is what a subconfig looks like:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
-->
<connectionStrings>
<add name="RavenDB" connectionString="Url=http://xxx/databases/xxx" xdt:Transform="Replace" xdt:Locator="Match(name)"/>
</connectionStrings>
<appSettings>
<add key="BaseUrl" value="http://xxx" xdt:Transform="SetAttributes" xdt:Locator="Match(key)"/>
</appSettings>
<system.net>
<defaultProxy enabled="true" />
<mailSettings>
<smtp xdt:TrandeliveryMethod="Network" transform="Replace">
<network xdt:Transform="Replace" host="xxx" defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
</configuration>
More info on web.config transforms
http://www.hanselman.com/blog/ManagingMultipleConfigurationFileEnvironmentsWithPreBuildEvents.aspx
The way I handle this problem is by adding a folder into my app that has only assets that don't get included in the build/publish. One of the things I include in that folder is DeveloperName.App.config files for each of my developers. Then I leave the the actual App.config file out of source control. When they check out the project, they copy their personalized DeveloperName.App.config file to the project folder and rename it to App.config.
This isn't perfect, but it gives you at least most of the goals you're looking for: The developers each get their own App.config file they can maintain and keep in source control. And the changes they make to App.config don't clobber each other every check-in.
I tried using the SlowCheetah extension, but I can't seem to get it to work. I think i may have missed a step somewhere.
I downloaded the extension and installed it.
The i created my web.config file and did the "add transform"
To test it, I was already using ELmah in my project, so I tried giving it different email address to send the error log for every config, and none in the web.config.
web.config
<elmah>
<security allowRemoteAccess="0"/>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="C:\myLogPath"/>
<errorFilter>
<test>
<or>
<equal binding="HttpStatusCode" value="404" type="Int32"/>
<is-type binding="BaseException" type="System.FieldAccessException" />
</or>
</test>
</errorFilter>
</elmah>
web.debug.config
<elmah>
<errorMail from="error-debug#domain.tld" to="me#domain.tld" priority="High" xdt:Transform="Insert"/>
</elmah>
So, when i look at "preview transform", it seems like the result is what i want. Then I start my application (either with F5 or ctrl+F5) and purposely throw an exception on my website to trigger Elmah error reporting, but I never get any email. If I add the errorMail line in my web.config, I do get an email, so the problem is not coming from Elmah.
As I said, i feel like I may have missed a simple step in setting up the extension.
The problem you are running into isn't really with SlowCheetah, but how you are launching your web application from Visual Studio.
SlowCheetah will indeed add the necessary MSBuild Targets to your project in order to do transforms upon build, but only for things included in your project output (i.e. the \bin folder).
When you build a web application your web.config stays put, and only the assemblies are copied into your \bin folder. Visual studio fires up the WebDev server and points it to the root directory of your web application. Since your web.config hasn't been modified, it will always contain the original contents.
To my knowledge, slow-Cheetah supports config transforms for the app.config files but not web.configs on debug at present. It should put a transformed web.config file in the bin folder of your project but your project still reads from the config file in the root folder. Please have a look at a workaround at http://sedodream.com/CommentView,guid,68b7e248-b9f5-4d07-bdfe-eb037bcf2cbb.aspx. This works for me instead of using Slow-Cheetah.
You can also request for web config transform support for Slow-Cheetah on debug at
https://github.com/sayedihashimi/slow-cheetah/issues/39 They are considering adding web support on F5 to it.
This is a bit of a weird one. I'm doing an MVC 3 code first development using the SQL compact 4 stuff. Its all running fine but I'm getting issues when I try to scaffold a new controller. I fire up the new controller dialog and select my entity and the datacontext (both of which are in a separate assembly in the same solution) and get the following error:
Unable to retrieve metadata for 'MyNamespace.MyClassName'. Access to the database file is not allowed. [ 1884,File name=C:\Program Files\Microsoft Visual Studio 10.0\Common7\EntityContext.sdf,SeCreateFile ]
That file does not exist on disk at the moment - the EntityContext.sdf file is sat in my App_Data folder. I'm not sure if its trying to create that file (and if so why?) but if it is I'm not logged in as admin so it won't have permissions. In that case do I need to define a difference working folder or something?
I've tried it running as admin now and it works, so it's definitely trying to create a file in my Program Files directory, there must be a setting for temp files somewhere?
Any help would be great :)
Did you find an answer to the issue? I was having the same problem but handled it through the deployment transforms...
In Web.Config I used full path to the SDF:
<configuration>
<connectionStrings>
<add
name="DBContext"
connectionString="Data Source=C:\full-path\DBContext.sdf"
providerName="System.Data.SqlServerCe.4.0" />
...
In Web.Release.config I replace the connectionString attribute...
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add
name="DBContext"
connectionString="Data Source=\DBContext.sdf"
xdt:Transform="SetAttributes"
xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
</system.web>
</configuration>
After a release deploy the correct "|DataDirectory|" setting is made rather than "C:\full-path\".
I would like a fix to the original issue though!!
PK :-)
I have also faced the same problem when tried to export SQL CE db script with number of utils. Got error "Access to the database file is not allowed". Then I have just connected to that db-file from VS2010, copied connection string and... it worked! :)
I ran into this issue when using the T4Scaffolding. I got around the problem by installing the MVCScaffolding nuget package and used the "MVCScaffolding: Controller with read/write action and views, using EF data access code" template. It produces similar controller actions and views. I was unable to uninstall and reinstall the T4Scaffolding nuget package to see if this was a bug or corrupt install.