Contentfile in nuget gets compiled causing build errors - json

I have a nuget that has a contentfile in it. It is a json file and denoted in the nuspec file when the nuget is packed.
When installing the nuget in a regular wpf app, I get a couple build errors. It appears that Visual Studio is trying to compile the .json file. Wondering if anyone knows what may cause this. As you'll see in the nuspec snippet I have BuildAction=None in the nuspec
ContentFile.json(1,1,1,2): error CS1022: Type or namespace definition, or end-of-file expected
ContentFile.json(4,16,4,26): error CS1001: Identifier expected
ContentFile.json(4,37,4,45): error CS1001: Identifier expected

When installing the nuget in a regular wpf app, I get a couple build
errors. It appears that Visual Studio is trying to compile the .json
file. Wondering if anyone knows what may cause this. As you'll see in
the nuspec snippet I have BuildAction=None in the nuspec
I think the main point is that you mistakenly assume that <files include="path"> is the path of the source file ContentFile.json in your current nuget project, which is actually the path relative to the contentFiles folder inside the nuget package(xxxx.nupkg).(You can view the contentFiles folder by decompressing the xxx.nupkg file).
Besides, you can check this official document for more detailed info.
As a right guidance, you can try this step:
Solution
change to these in xxx.nuspec file
....
<metadata>
....
<contentFiles>
<files include="any/any/ContentFile.json"(the relativepath of the file under the ContentFiles folder in the xxx.nupkg) buildAction="None" copyToOutput="true" flatten="false" />
</contentFiles>
</metadata>
<files>
<file src="xxxxx/Resource/ContentFile.json(the relativePath of the file under the nuget project)" target="contentFiles/any/any" />
</files>
....
Before you install this package into another project , do not forget to clean the nuget cache.
In additon, you can check this thread for more info.
Hope it could help you.

Related

Warning: Could not find file C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar\co

I am getting this error while running the Student Management System project in netbeans Ide project in made in java,jsp,html.Please help me
Your project's build has a dependency on the Java ARchive (.jar file) com.mysql.jdbc_5.1.5
There are two possibilities that I see here, without further details on what you have done so far:
1) You already downloaded the jar, but when you specified the path where your build process is gonna look for that file you had an error in your path ... make sure you have a jar file in C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar or C:\Users\Harsh Jain\Downloads\com.mysql.jdbc_5.1.5.jar\com.mysql.jdbc_5.1.5.jar (I'm thinking you might have copied the name of the jar file twice in your path).
2) If you have not manually downloaded that file, then you should do so. You can find that version at http://www.java2s.com/Code/Jar/c/Downloadcommysqljdbc515jar.htm (or elsewhere). Once downloaded, make sure to copy/unzip the actual JAR file to your C:\Users\Harsh Jain\Downloads folder.
Once you have ensured the file is actually on your system AND in the right path, run the build again.

Importing a downloaded JAR file into a Servlet

I have recently downloaded the json-lib jar, and added it to my libraries using NetBean's library wizard.
I believe to import net.sf.json.JSONObject, I first have to call the package at the beginning of the servlet file.
However, when I try to do 'package net.sf.json', I get the error 'class, interface or enum expected'.
I have placed the jar in the WEB-INF/lib folder. I am certain I'm missing something, but I'm not certain what. Any advice would be appreciated.

Go - import sql.a: not a package file

I am using go 1.3. When i try to do mysql connectivity in golang it's working fine in linux console. While trying to do the same using go-ide 1.0 it throws like
"import
/home/gold/software/go-ide/bundled/go-sdk/pkg/linux_amd64/database/sql.a:
not a package file"
Any one please suggest me how to solve this error.
>go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/local/go/bin:/home/gold/software/go-ide/bundled/go-sdk/bin"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
Have no clue about go-ide but it looks like that IDE comes with a bundled go installation that is somehow broken.
database/sql is a standard package, the compiled file should be at$GOROOT/pkg/linux_amd64/database/sql.a.
According to your error message, your IDE somehow sets GOROOT to
/home/gold/software/go-ide/bundled/go-sdk.
So you either fix the go installation in that path or tell the IDE about the real GOROOT.
GOPATH="/usr/local/go/bin:/home/gold/software/go-ide/bundled/go-sdk/bin"
Your GOPATH is not supposed to reference bin folders.
It should reference the parent folder, in which you have bin/, src/ and pkg/ sub-folders.

JSLint with Sublime text 2 - The system cannot find the file specified

I have installed JSlint properly but when I tried to run it I got below error:
[Error 2] The system cannot find the file specified
[cmd: [u'/usr/local/bin/node', u'/usr/local/bin/jslint', u'--sloppy', u'--indent', u'2', u'--node', u'--nomen', u'--vars', u'--plusplus', u'--stupid', u'']]
[dir: C:\Users\agrawal_d\AppData\Roaming\Sublime Text 2\Packages]
[path: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;c:\Python27;C:\Program Files\nodejs\;C:\Users\agrawal_d\AppData\Roaming\npm]
[Finished]
Not understanding why it's showing this, can anyone please give me the solution
I got this problem as well and I hacked the file JSLint.sublime-build under installed JSLint package directory by replacing /usr/local/bin/node by the path to my node and it works.
Seems you're installing sublime text under windows platform. maybe you need to find the path to your node installation (e.g., C:\Program Files\nodejs\bin\node) and make sure the JSLint package can find it.
jslint most likely must be separately installed on your computer using Node and NPM package manager
Please follow the plug-in installation instructions on the plug-in README.
Here is a guide with some pictures
http://opensourcehacker.com/2012/04/12/jslint-integration-for-sublime-text-2/
It seems weird but in my case the solution is different. I was getting following error:
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'c:\\users\\arvind~1\\appdata\\local\\temp\\SublimeLinter3-arvind\\app.js'
I checked the c:\\users\\arvind~1\\appdata\\local\\temp\\ folder and found that it had not SublimeLinter3-arvind folder. I created this folder manually and JSHint it started working..

Adding editFTPnetPRO to SSIS package causes error message

I'm trying to add some secure FTP code to an SSIS package. I've used the EnterpriseDT product successfully on other .NET projects, so I wanted to incorporate it into an SSIS 2008 package I'm working on.
If I create a Script Task (VB), edit the script, choose Project | Add Reference, and select the editFTPnetPRO.dll file, it comes back with this error:
No template information found. See the application log in Event Viewer for more details.
To open Event Viewer, click Start, click Control Panel, double-click Administrative Tools, and then double-click Event Viewer.
The application log doesn't contain any pertinent details.
I have no idea what this is trying to tell me. I've gone down a couple dead ends searching for this error message and following the prescribed fixes, but nothing has fixed it yet. Any idea what might be going wrong?
P.S. - I tried the devenv.exe /installvstemplates fix, which didn't change anything.
Update: Here is the error captured in the SSIS package when you try to run it:
Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'edtFTPnetPRO, Version=6.3.1.20, Culture=neutral, PublicKeyToken=0dce1ad63760d80b' or one of its dependencies. The system cannot find the file specified.
Where is it looking for this file? I tried copying it to the project direcory, the bin folder, and the C:\WINDOWS\Microsoft.NET\Framework\v2.0.nnnn folder, but it still can't find it, and it won't tell me where it's looking.
I'm now having this same problem with a custom C# assembly that I created to use with SSIS. I have added the assembly to the Windows\assembly and C:\WINDOWS\Microsoft.NET\Framework\v2.0.nnnn folders.
Put your DLL into C:\Program Files\Microsoft SQL Server\100\DTS\Binn and try again.
I have encountered this error a few times while attempting to add a reference from the .NET tab of the Add Reference dialog.
The (painfully simple) fix is to use the Browse tab to add the reference.